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

Unified Diff: LayoutTests/fast/dom/exception-in-binding.html

Issue 121113004: Improve handling of failed integer type conversions. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 6 years, 11 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: LayoutTests/fast/dom/exception-in-binding.html
diff --git a/LayoutTests/fast/dom/exception-in-binding.html b/LayoutTests/fast/dom/exception-in-binding.html
index 8efc252da429a0c0ac500a7b983b81a898535753..55c8eab14848b87f2b89e7c1c8d285b83997bcf6 100644
--- a/LayoutTests/fast/dom/exception-in-binding.html
+++ b/LayoutTests/fast/dom/exception-in-binding.html
@@ -1,52 +1,43 @@
<!DOCTYPE html>
<html>
<head>
- <meta charset="utf-8">
- <script src="../../resources/js-test.js"></script>
- <script>
- description("Tests to ensure that attributes are not set when an exceptions is raised while converting argument to JSValue.");
- function setName(select) {
- var stringLike = {
- toString: function() {
- throw new Error("error");
- }
- };
- select.name = stringLike;;
- }
-
- function setSelectedIndex(select) {
- var integerLike = {
- valueOf: function() {
- throw new Error("error");
- }
- };
- select.selectedIndex = integerLike;;
- }
-
- function runTest() {
- var select = document.getElementById("select");
- try {
- setName(select);
- } catch(e) {
+<script src="../../resources/js-test.js"></script>
+<script>
+description("Tests to ensure that attributes are not set when an exceptions is raised while converting argument to JSValue.");
+window.jsTestIsAsync = true;
+function setName(select) {
+ var stringLike = {
+ toString: function() {
+ throw new Error("error");
}
- shouldBe('select.name', '"select"');
+ };
+ select.name = stringLike;
+}
- try {
- setSelectedIndex(select);
- } catch(e) {
+function setSelectedIndex(select) {
+ var integerLike = {
+ valueOf: function() {
+ throw new Error("error");
}
- shouldBe('select.selectedIndex', '1');
- }
- </script>
+ };
+ select.selectedIndex = integerLike;
+}
+
+function runTest() {
+ shouldThrow('setName(select)');
+ shouldBe('select.name', '"select"');
- </head>
- <body onload="runTest()">
- <select id="select" name="select">
- <option value="value1">Value 1</option>
- <option value="value2" selected>Value 2</option>
- <option value="value3">Value 3</option>
- </select>
- <p id="description"></p>
- <script src="../../resources/js-test.js"></script>
+ shouldThrow('setSelectedIndex(select)');
+ shouldBe('select.selectedIndex', '1');
+ finishJSTest();
+}
+</script>
+</head>
+<body onload="runTest()">
+<select id="select" name="select">
+ <option value="value1">Value 1</option>
+ <option value="value2" selected>Value 2</option>
+ <option value="value3">Value 3</option>
+</select>
</body>
</html>
« no previous file with comments | « LayoutTests/fast/canvas/webgl/gl-object-get-calls-expected.txt ('k') | LayoutTests/fast/dom/exception-in-binding-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698