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

Unified Diff: third_party/WebKit/LayoutTests/editing/undo/undo-iframe-location-change.html

Issue 2110543008: Move UndoStack from Page to Editor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use |const Member| and add notes to UndoStack class Created 4 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/editing/undo/undo-iframe-location-change-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/editing/undo/undo-iframe-location-change.html
diff --git a/third_party/WebKit/LayoutTests/editing/undo/undo-iframe-location-change.html b/third_party/WebKit/LayoutTests/editing/undo/undo-iframe-location-change.html
index 6b7aa2c2a280a7ec6ddfa73c5aaf1b622fb18015..049ac0593afb3b23a3470d5058a99bcb91d3df2f 100644
--- a/third_party/WebKit/LayoutTests/editing/undo/undo-iframe-location-change.html
+++ b/third_party/WebKit/LayoutTests/editing/undo/undo-iframe-location-change.html
@@ -1,49 +1,34 @@
-<script src="../editing.js"></script>
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
<script>
-function log(message) {
- var console = document.getElementById("console");
- var li = document.createElement("li");
- var text = document.createTextNode(message);
- li.appendChild(text);
- console.appendChild(li);
-}
-
function part1() {
- frames['iframe'].document.body.focus();
-
- // Hack to perform the editing command. Should be able to
- // call execCommand on the main document.
- frames['iframe'].document.execCommand('InsertText', false, 'c');
+ add_result_callback(function(result) {
+ if (result.status == result.PASS)
+ window.location = window.location.toString() + '?part2';
+ });
- if (frames['iframe'].document.body.innerText != 'c') {
- log("FAIL: could not insert text.");
- if (window.testRunner)
- testRunner.notifyDone();
- return;
- }
+ test(function() {
+ frames['iframe'].document.body.focus();
+ frames['iframe'].document.execCommand('InsertText', false, 'c');
- if (!document.queryCommandEnabled('Undo')) {
- log("FAIL: Undo is not enabled after text insertion.");
- if (window.testRunner)
- testRunner.notifyDone();
- return;
- }
+ assert_equals(frames['iframe'].document.body.innerText, 'c',
+ 'Text should be inserted into the subframe.');
- window.location = window.location.toString() + "?part2";
+ assert_false(document.queryCommandEnabled('Undo'),
+ 'Undo should not be enabled in main document by text insertion in subframe.');
+ }, 'Checks with modification in the subframe.');
}
function part2() {
- if (frames['iframe'].document.body.innerText != '')
- log("FAIL: subframe still has old content after navigaiton.");
+ test(function() {
+ assert_equals(frames['iframe'].document.body.innerText, '',
+ 'Subframe should not have old content after navigaiton.');
- if (!document.queryCommandEnabled('Undo'))
- log("Success");
- else
- log("Failure, Undo was still enabled after the location changed (but at least we didn't crash!)");
-
- if (window.testRunner)
- testRunner.notifyDone();
+ assert_false(document.queryCommandEnabled('Undo'),
+ 'Undo should not be enabled after the location changed.');
+ }, 'Checks after the subframe has navigated');
}
function runTest() {
@@ -53,15 +38,9 @@ function runTest() {
part2();
}
}
-
-if (window.testRunner) {
- testRunner.waitUntilDone();
- testRunner.dumpAsText();
-}
-
</script>
<body onload="runTest()">
<iframe name="iframe" src="../resources/contenteditable-iframe-src.html"></iframe>
-<ul id="console"></ul>
+<div id="log"></div>
</body>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/editing/undo/undo-iframe-location-change-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698