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

Unified Diff: third_party/WebKit/LayoutTests/inspector-protocol/page/setDocumentContent.js

Issue 2972273002: DevTools: Page.setDocumentContent without using DOMPatchSupport (Closed)
Patch Set: Created 3 years, 5 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector-protocol/page/setDocumentContent-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/inspector-protocol/page/setDocumentContent.js
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/page/setDocumentContent.js b/third_party/WebKit/LayoutTests/inspector-protocol/page/setDocumentContent.js
new file mode 100644
index 0000000000000000000000000000000000000000..6131fa3712f74a15dfa60a0fc673851be9576378
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/inspector-protocol/page/setDocumentContent.js
@@ -0,0 +1,18 @@
+(async function(testRunner) {
+ let {page, session, dp} = await testRunner.startHTML(`<div>Привет мир</div>`,
+ 'Tests that Page.setDocumentContent works.');
+
+ await dp.Page.enable();
+ testRunner.log('Page enabled');
+
+ var resourceTreeResponse = await dp.Page.getResourceTree();
+ var mainFrameId = resourceTreeResponse.result.frameTree.frame.id;
+ testRunner.log('Main Frame obtained');
+
+ testRunner.log('Document content before: ' + await session.evaluate(() => document.documentElement.outerHTML));
+ await dp.Page.setDocumentContent({frameId: mainFrameId, html: '<div>こんにちは世界</div>'});
+ testRunner.log('Document content set');
+ testRunner.log('Document content after: ' + await session.evaluate(() => document.documentElement.outerHTML));
+
+ testRunner.completeTest();
+})
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector-protocol/page/setDocumentContent-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698