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

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

Issue 2127463002: Revert of Move UndoStack from Page to Editor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 049ac0593afb3b23a3470d5058a99bcb91d3df2f..6b7aa2c2a280a7ec6ddfa73c5aaf1b622fb18015 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,34 +1,49 @@
-<!DOCTYPE html>
-<script src="../../resources/testharness.js"></script>
-<script src="../../resources/testharnessreport.js"></script>
+<script src="../editing.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() {
- add_result_callback(function(result) {
- if (result.status == result.PASS)
- window.location = window.location.toString() + '?part2';
- });
+ 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');
- test(function() {
- frames['iframe'].document.body.focus();
- frames['iframe'].document.execCommand('InsertText', false, 'c');
+ if (frames['iframe'].document.body.innerText != 'c') {
+ log("FAIL: could not insert text.");
+ if (window.testRunner)
+ testRunner.notifyDone();
+ return;
+ }
- assert_equals(frames['iframe'].document.body.innerText, 'c',
- 'Text should be inserted into the subframe.');
+ if (!document.queryCommandEnabled('Undo')) {
+ log("FAIL: Undo is not enabled after text insertion.");
+ if (window.testRunner)
+ testRunner.notifyDone();
+ return;
+ }
- assert_false(document.queryCommandEnabled('Undo'),
- 'Undo should not be enabled in main document by text insertion in subframe.');
- }, 'Checks with modification in the subframe.');
+ window.location = window.location.toString() + "?part2";
}
function part2() {
- test(function() {
- assert_equals(frames['iframe'].document.body.innerText, '',
- 'Subframe should not have old content after navigaiton.');
+ if (frames['iframe'].document.body.innerText != '')
+ log("FAIL: subframe still has old content after navigaiton.");
- assert_false(document.queryCommandEnabled('Undo'),
- 'Undo should not be enabled after the location changed.');
- }, 'Checks after the subframe has navigated');
+ 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();
}
function runTest() {
@@ -38,9 +53,15 @@
part2();
}
}
+
+if (window.testRunner) {
+ testRunner.waitUntilDone();
+ testRunner.dumpAsText();
+}
+
</script>
<body onload="runTest()">
<iframe name="iframe" src="../resources/contenteditable-iframe-src.html"></iframe>
-<div id="log"></div>
+<ul id="console"></ul>
</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