Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(41)

Unified Diff: third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-clear-of-command-line-api.html

Issue 2954093003: [DevTools] Migrate inspector-protocol/runtime tests to new harness (Closed)
Patch Set: fail: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-clear-of-command-line-api.html
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-clear-of-command-line-api.html b/third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-clear-of-command-line-api.html
deleted file mode 100644
index 797aa53284a749d900e7b0e6c6a53009bb0969bb..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-clear-of-command-line-api.html
+++ /dev/null
@@ -1,127 +0,0 @@
-<html>
-<head>
-<script type="text/javascript" src="../../http/tests/inspector-protocol/resources/inspector-protocol-test.js"></script>
-<script>
-
-var methods = ["dir","dirxml","profile","profileEnd","clear","table","keys","values","debug","undebug","monitor","unmonitor","inspect","copy"];
-
-function presentedAPIMethods()
-{
- var methodCount = 0;
- for (var method of methods) {
- try {
- if (eval("window." + method + "&&" + method + ".toString ? " + method + ".toString().indexOf(\"[Command Line API]\") !== -1 : false"))
- ++methodCount;
- } catch (e) {
- }
- }
- methodCount += eval("\"$_\" in window ? $_ === 239 : false") ? 1 : 0;
- return methodCount;
-}
-
-function setPropertyForMethod()
-{
- window.dir = 42;
-}
-
-function defineValuePropertyForMethod()
-{
- Object.defineProperty(window, "dir", { value: 42 });
-}
-
-function defineAccessorPropertyForMethod()
-{
- Object.defineProperty(window, "dir", { set: function() {}, get: function(){ return 42 } });
-}
-
-function definePropertiesForMethod()
-{
- Object.defineProperties(window, { "dir": { set: function() {}, get: function(){ return 42 } }});
-}
-
-var builtinGetOwnPropertyDescriptorOnObject;
-var builtinGetOwnPropertyDescriptorOnObjectPrototype;
-var builtinGetOwnPropertyDescriptorOnWindow;
-
-function redefineGetOwnPropertyDescriptors()
-{
- builtinGetOwnPropertyDescriptorOnObject = Object.getOwnPropertyDescriptor;
- Object.getOwnPropertyDescriptor = function() {}
- builtinGetOwnPropertyDescriptorOnObjectPrototype = Object.prototype.getOwnPropertyDescriptor;
- Object.prototype.getOwnPropertyDescriptor = function() {}
- builtinGetOwnPropertyDescriptorOnWindow = window.getOwnPropertyDescriptor;
- window.getOwnPropertyDescriptor = function() {}
-}
-
-function restoreGetOwnPropertyDescriptors()
-{
- Object.getOwnPropertyDescriptor = builtinGetOwnPropertyDescriptorOnObject;
- Object.prototype.getOwnPropertyDescriptor = builtinGetOwnPropertyDescriptorOnObjectPrototype;
- window.getOwnPropertyDescriptor = builtinGetOwnPropertyDescriptorOnWindow;
-}
-
-
-function test()
-{
- runExpressionAndDumpPresentedMethods("")
- .then(() => dumpLeftMethods())
- .then(() => runExpressionAndDumpPresentedMethods("setPropertyForMethod()"))
- .then(() => dumpLeftMethods())
- .then(() => dumpDir())
- .then(() => runExpressionAndDumpPresentedMethods("defineValuePropertyForMethod()"))
- .then(() => dumpLeftMethods())
- .then(() => dumpDir())
- .then(() => runExpressionAndDumpPresentedMethods("definePropertiesForMethod()"))
- .then(() => dumpLeftMethods())
- .then(() => dumpDir())
- .then(() => runExpressionAndDumpPresentedMethods("defineAccessorPropertyForMethod()"))
- .then(() => dumpLeftMethods())
- .then(() => dumpDir())
- .then(() => runExpressionAndDumpPresentedMethods("redefineGetOwnPropertyDescriptors()"))
- .then(() => dumpLeftMethods())
- .then(() => dumpDir())
- .then(() => evaluate("restoreGetOwnPropertyDescriptors()", false))
- .then(() => InspectorTest.completeTest());
-
- function evaluate(expression, includeCommandLineAPI)
- {
- var cb;
- var p = new Promise(resolver => cb = resolver);
- InspectorTest.sendCommandOrDie("Runtime.evaluate", { expression: expression, objectGroup: "console", includeCommandLineAPI: includeCommandLineAPI }, cb);
- return p;
- }
-
- function setLastEvaluationResultTo239()
- {
- return evaluate("239", false);
- }
-
- function runExpressionAndDumpPresentedMethods(expression)
- {
- InspectorTest.log(expression);
- return setLastEvaluationResultTo239()
- .then(() => evaluate(expression + "; var a = presentedAPIMethods(); a", true))
- .then((result) => InspectorTest.logObject(result));
- }
-
- function dumpLeftMethods()
- {
- // Should always be zero.
- return setLastEvaluationResultTo239()
- .then(() => evaluate("presentedAPIMethods()", false))
- .then((result) => InspectorTest.logObject(result));
- }
-
- function dumpDir()
- {
- // Should always be presented.
- return evaluate("dir", false)
- .then((result) => InspectorTest.logObject(result));
- }
-}
-</script>
-</head>
-<body onLoad="runTest();">
-Tests that CommandLineAPI is presented only while evaluation.
-</body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698