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

Unified Diff: third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-command-line-api-can-be-overriden.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-command-line-api-can-be-overriden.html
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-command-line-api-can-be-overriden.html b/third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-command-line-api-can-be-overriden.html
deleted file mode 100644
index 2391e18826e3359f4139a4c6316f83ecba92abe0..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-command-line-api-can-be-overriden.html
+++ /dev/null
@@ -1,78 +0,0 @@
-<html>
-<head>
-<script type="text/javascript" src="../../http/tests/inspector-protocol/resources/inspector-protocol-test.js"></script>
-<script>
-
-function overrideDir()
-{
- var v = "" + dir;
- dir = 239;
- return v + " -> " + dir;
-}
-
-function override$_()
-{
- var v = "" + $_;
- $_ = 239;
- return v + " -> " + $_;
-}
-
-function doesCommandLineAPIEnumerable()
-{
- for (var v in window) {
- if (v === "dir" || v === "$_")
- return "enumerable";
- }
- return "non enumerable";
-}
-
-function test()
-{
- function evaluatePromise(expression)
- {
- var cb;
- var p = new Promise(resolver => cb = resolver);
- InspectorTest.sendCommandOrDie("Runtime.evaluate", { "expression": expression, objectGroup: "console", includeCommandLineAPI: true }, cb);
- return p;
- }
-
- evaluatePromise("doesCommandLineAPIEnumerable()")
- .then(dumpResult.bind(null, "Check that CommandLineAPI isn't enumerable on window object:"))
- .then(() => evaluatePromise("overrideDir()"))
- .then(dumpResult.bind(null, "Override dir:"))
- .then(() => evaluatePromise("\"\" + dir"))
- .then(dumpResult.bind(null, "CommandLineAPI doesn't override dir:"))
- .then(() => evaluatePromise("delete dir"))
- .then(() => evaluatePromise("overrideDir()"))
- .then(dumpResult.bind(null, "CommandLineAPI is presented after removing override variable:"))
- // set $_ to 42
- .then(() => evaluatePromise("42"))
- .then(() => evaluatePromise("override$_()"))
- .then(dumpResult.bind(null, "Override $_:"))
- .then(() => evaluatePromise("\"\" + $_"))
- .then(dumpResult.bind(null, "CommandLineAPI doesn't override $_:"))
- .then(() => evaluatePromise("delete $_"))
- .then(() => evaluatePromise("override$_()"))
- .then(dumpResult.bind(null, "CommandLineAPI is presented after removing override variable:"))
- .then(() => evaluatePromise("var dir = 1; \"\" + dir"))
- .then(dumpResult.bind(null, "CommandLineAPI can be overridden by var dir = 1:"))
- .then(() => evaluatePromise("\"\" + dir"))
- .then(dumpResult.bind(null, "CommandLineAPI doesn't override var dir = 1:"))
- .then(() => evaluatePromise("Object.defineProperty(window, \"copy\", { get: () => 239 }); \"\" + copy"))
- .then(dumpResult.bind(null, "CommandLineAPI can be overridden by Object.defineProperty:"))
- .then(() => evaluatePromise("\"\" + copy"))
- .then(dumpResult.bind(null, "CommandLineAPI doesn't override Object.defineProperty:"))
- .then(() => InspectorTest.completeTest());
-
- function dumpResult(title, message)
- {
- InspectorTest.log(title);
- InspectorTest.log(message.result.value);
- }
-}
-</script>
-</head>
-<body onLoad="runTest();">
-Tests that Command Line API doesn't override defined on window methods and can be overridden during evaluation.
-</body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698