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

Unified Diff: third_party/WebKit/LayoutTests/fast/dom/inert/inert-node-is-uneditable.html

Issue 2088453002: Implement the inert attribute (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: esprehn comments and fix layout tests to use testharness.js Created 4 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/fast/dom/inert/inert-node-is-uneditable.html
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/inert-node-is-uneditable.html b/third_party/WebKit/LayoutTests/fast/dom/inert/inert-node-is-uneditable.html
similarity index 52%
copy from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/inert-node-is-uneditable.html
copy to third_party/WebKit/LayoutTests/fast/dom/inert/inert-node-is-uneditable.html
index 72561141896ced902cfa85187b9e5b18cfdb17c6..19460ac1086b50af42445774a2e7eab55a752a99 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/inert-node-is-uneditable.html
+++ b/third_party/WebKit/LayoutTests/fast/dom/inert/inert-node-is-uneditable.html
@@ -1,13 +1,12 @@
<!DOCTYPE html>
<html>
<head>
-<script src="../../../resources/js-test.js"></script>
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
</head>
<body>
-<span id="not-editable" contenteditable>I'm not editable.</span>
-<dialog>
- <span id="editable" contenteditable>I'm editable.</span>
-</dialog>
+<span inert id="not-editable" contenteditable>I'm not editable.</span>
+<span id="editable" contenteditable>I'm editable.</span>
<script>
function clickOn(element)
{
@@ -29,32 +28,23 @@ function clickOn(element)
eventSender.mouseMoveTo(0, 0);
}
-function test()
-{
- description('Test that inert nodes cannot be edited. The test passes if the only text you can edit is in the dialog.');
-
- dialog = document.querySelector('dialog');
- dialog.showModal();
- notEditable = document.querySelector('#not-editable');
- editable = document.querySelector('#editable');
+notEditable = document.querySelector('#not-editable');
+editable = document.querySelector('#editable');
- if (!window.eventSender)
- return;
+test(function() {
clickOn(notEditable);
oldValue = notEditable.textContent;
eventSender.keyDown('a');
- shouldBe('notEditable.textContent', 'oldValue');
+ assert_equals(notEditable.textContent, oldValue);
+}, "Can't edit inert contenteditable");
+test(function() {
clickOn(editable);
oldValue = editable.textContent;
eventSender.keyDown('a');
- shouldNotBe('editable.textContent', 'oldValue');
-
- notEditable.remove();
- editable.remove();
-}
+ assert_not_equals(editable.textContent, oldValue);
+}, "Can edit non-inert contenteditable");
-test();
</script>
</body>
</html>

Powered by Google App Engine
This is Rietveld 408576698