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

Unified Diff: third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-console-log-handle-navigate.js

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-console-log-handle-navigate.js
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-console-log-handle-navigate.js b/third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-console-log-handle-navigate.js
new file mode 100644
index 0000000000000000000000000000000000000000..7aca3c28932a4c2c9856fbb8928d896aac61581c
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-console-log-handle-navigate.js
@@ -0,0 +1,28 @@
+(async function(testRunner) {
+ let {page, session, dp} = await testRunner.startBlank(`This tests how navigation is handled from inside debugger code (console.log).`);
+
+ await session.evaluateAsync(`
+ function appendIframe(url) {
+ var frame = document.createElement('iframe');
+ frame.id = 'iframe';
+ frame.src = url;
+ document.body.appendChild(frame);
+ return new Promise(resolve => frame.onload = resolve);
+ }
+ appendIframe('${testRunner.url('../resources/console-log-navigate-on-load.html')}')
+ `);
+
+ await dp.Runtime.enable();
+ await checkExpression('logArray()');
+ await checkExpression('logDate()');
+ await checkExpression('logDateWithArg()');
+ testRunner.completeTest();
+
+ async function checkExpression(expression) {
+ var contextId;
+ dp.Runtime.onceExecutionContextCreated().then(result => contextId = result.params.context.id);
+ await session.evaluateAsync(`appendIframe('${testRunner.url('../resources/console-log-navigate.html')}')`);
+ testRunner.log(`Got new context: ${contextId !== undefined}`);
+ testRunner.logMessage(await dp.Runtime.evaluate({ expression: expression, contextId: contextId }));
+ }
+})

Powered by Google App Engine
This is Rietveld 408576698