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

Unified Diff: third_party/WebKit/LayoutTests/fast/forms/resources/textarea-live-pseudo-selectors.js

Issue 1522803002: Move textarea-related tests to fast/forms/textarea/, part 1. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@color-uaf
Patch Set: Created 5 years 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/forms/resources/textarea-live-pseudo-selectors.js
diff --git a/third_party/WebKit/LayoutTests/fast/forms/resources/textarea-live-pseudo-selectors.js b/third_party/WebKit/LayoutTests/fast/forms/resources/textarea-live-pseudo-selectors.js
deleted file mode 100644
index fa5a7f14c323e90c727354d7eed0f574f14684e6..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/fast/forms/resources/textarea-live-pseudo-selectors.js
+++ /dev/null
@@ -1,103 +0,0 @@
-description("This test performs a check that :valid/:invalid CSS psudo selectors are lively applied.");
-
-// Setup for static elements.
-var form = document.createElement('form');
-document.body.appendChild(form);
-var nonForm = document.createElement('div');
-document.body.appendChild(nonForm);
-
-function makeInvalid() {
- var i = document.createElement('textarea');
- i.name = 'foo';
- i.required = true;
- i.value = '';
- form.appendChild(i);
- return i;
-}
-
-function backgroundOf(el) {
- return document.defaultView.getComputedStyle(el, null).getPropertyValue('background-color');
-}
-
-var elBackground = 'backgroundOf(el)';
-var invalidColor = 'rgb(255, 0, 0)';
-var normalColor = 'rgb(255, 255, 255)';
-var disabledColor = 'rgb(0, 0, 0)';
-var readOnlyColor = 'rgb(0, 255, 0)';
-var validColor = 'rgb(0, 0, 255)';
-
-// --------------------------------
-// willValidate change
-// --------------------------------
-var el = makeInvalid();
-// Confirm this element is invalid.
-debug('Chheck the initial state:');
-shouldBe(elBackground, 'invalidColor');
-
-debug('Change name:');
-el.name = '';
-shouldBe(elBackground, 'invalidColor');
-el.name = 'bar';
-shouldBe(elBackground, 'invalidColor');
-
-debug('Change disabled:');
-el = makeInvalid();
-el.disabled = true;
-shouldBe(elBackground, 'disabledColor');
-el.disabled = false;
-shouldBe(elBackground, 'invalidColor');
-
-debug('Change readOnly:');
-el = makeInvalid();
-el.readOnly = true;
-shouldBe(elBackground, 'readOnlyColor');
-el.readOnly = false;
-shouldBe(elBackground, 'invalidColor');
-
-debug('Inside/outside of a form:');
-el = makeInvalid();
-nonForm.appendChild(el);
-shouldBe(elBackground, 'invalidColor');
-form.appendChild(el);
-shouldBe(elBackground, 'invalidColor');
-
-// --------------------------------
-// value change
-// --------------------------------
-debug('Change the value by DOM attribute:');
-el = makeInvalid();
-el.value = 'abc';
-shouldBe(elBackground, 'validColor');
-el.value = '';
-shouldBe(elBackground, 'invalidColor');
-
-debug('Change the value by key input:');
-el = makeInvalid();
-el.focus();
-eventSender.keyDown('a');
-shouldBe(elBackground, 'validColor');
-eventSender.keyDown('backspace', []);
-shouldBe(elBackground, 'invalidColor');
-
-// --------------------------------
-// Constraints change
-// --------------------------------
-debug('Change required:');
-el = makeInvalid();
-el.required = false;
-shouldBe(elBackground, 'validColor');
-el.required = true;
-shouldBe(elBackground, 'invalidColor');
-
-debug('Change maxlength:');
-el = makeInvalid();
-el.value = '1234567890';
-shouldBe(elBackground, 'validColor');
-// Make the value dirty by deleting the last character.
-el.focus();
-el.setSelectionRange(10, 10);
-eventSender.keyDown('backspace');
-el.maxLength = 5;
-shouldBe(elBackground, 'invalidColor');
-el.maxLength = 10;
-shouldBe(elBackground, 'validColor');

Powered by Google App Engine
This is Rietveld 408576698