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/dom/dom-focus.js

Issue 2955943002: DevTools: migrate inspector-protocol/dom tests to a new test runner (Closed)
Patch Set: rebaseline 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/dom/dom-focus.js
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/dom/dom-focus.js b/third_party/WebKit/LayoutTests/inspector-protocol/dom/dom-focus.js
new file mode 100644
index 0000000000000000000000000000000000000000..b37f2104eb07a4eb1665b183b234ec35760d37d4
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/inspector-protocol/dom/dom-focus.js
@@ -0,0 +1,19 @@
+(async function(testRunner) {
+ var {page, session, dp} = await testRunner.startHTML(`
+ <input></input>
+ <input id='second'></input>
+ `, '');
+
+ testRunner.log(await session.evaluate(getActiveElement));
+ var document = (await dp.DOM.getDocument()).result.root;
+ var node = (await dp.DOM.querySelector({nodeId: document.nodeId, selector: '#second'})).result;
+ await dp.DOM.focus({nodeId: node.nodeId});
+ testRunner.log(await session.evaluate(getActiveElement));
+ testRunner.completeTest();
+
+ function getActiveElement() {
+ var el = document.activeElement;
+ return el ? (el.id || el.tagName) : '(none)';
+ }
+})
+

Powered by Google App Engine
This is Rietveld 408576698