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

Unified Diff: LayoutTests/fast/media/mq-js-media-except-01.html

Issue 15679021: Parse media attributes and CSSOM media text as media_query_list. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed review issues. Created 7 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
« no previous file with comments | « LayoutTests/fast/media/mq-append-delete.html ('k') | LayoutTests/fast/media/mq-parsing-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/media/mq-js-media-except-01.html
diff --git a/LayoutTests/fast/media/mq-js-media-except-01.html b/LayoutTests/fast/media/mq-js-media-except-01.html
index 85087220807361c133757d14882b58e4e3a091bc..a5f684c0c75258b938bfeb6ab88dbcdf35a73218 100644
--- a/LayoutTests/fast/media/mq-js-media-except-01.html
+++ b/LayoutTests/fast/media/mq-js-media-except-01.html
@@ -12,12 +12,16 @@ p#result { color: green;}
<script language="javascript">
function test() {
try {
- document.styleSheets[0].cssRules[0].media.deleteMedium("all and (");
- document.getElementById("result").innerHTML = "Success. This text should be green.";
+ document.styleSheets[0].cssRules[0].media.deleteMedium("all and (");
+ document.getElementById("result").innerHTML = "Failure. 'all and (' is not a valid media query and should become 'not all'. Not all is not present in the media rule, hence a DOMException.NOT_FOUND_ERR should be thrown."
}
catch(e) {
- document.getElementById("result").innerHTML = "Failure. 'all and (' is not a valid medium and should be ignored."
- document.getElementById("details").innerHTML = "Following exception was caught: " + e;
+ if (e.code == DOMException.NOT_FOUND_ERR)
+ document.getElementById("result").innerHTML = "Success. This text should be green.";
+ else {
+ document.getElementById("result").innerHTML = "Failure. Wrong exception thrown. Expected DOMException.NOT_FOUND_ERR.";
+ document.getElementById("details").innerHTML = "Following exception was caught: " + e;
+ }
}
}
</script>
« no previous file with comments | « LayoutTests/fast/media/mq-append-delete.html ('k') | LayoutTests/fast/media/mq-parsing-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698