Browse Source

Issue #1257 - Part 3: Remove/update tests.

This removes a ton of tests that are no longer relevant with (un)watch
removed (e.g. testing stability/bugs in the watchpoint system itself
which has never been the most stable), and updates others that would
previously rely on watch/unwatch, so that they don't unexpectedly fail.
pull/24/head
wolfbeast 3 years ago committed by Roy Tam
parent
commit
3d8d9f95df
  1. 58
      devtools/client/webconsole/test/browser_webconsole_bug_585991_autocomplete_keys.js
  2. 6
      dom/bindings/test/test_Object.prototype_props.html
  3. 1
      dom/html/test/mochitest.ini
  4. 129
      dom/html/test/test_document.watch.html
  5. 15
      dom/svg/crashtests/880544-1.svg
  6. 15
      dom/svg/crashtests/880544-2.svg
  7. 15
      dom/svg/crashtests/880544-3.svg
  8. 15
      dom/svg/crashtests/880544-4.svg
  9. 15
      dom/svg/crashtests/880544-5.svg
  10. 5
      dom/svg/crashtests/crashtests.list
  11. 14
      dom/tests/mochitest/bugs/iframe_bug38959-1.html
  12. 14
      dom/tests/mochitest/bugs/iframe_bug38959-2.html
  13. 3
      dom/tests/mochitest/bugs/mochitest.ini
  14. 57
      dom/tests/mochitest/bugs/test_bug38959.html
  15. 8
      js/src/jit-test/tests/auto-regress/bug466654.js
  16. 6
      js/src/jit-test/tests/auto-regress/bug516897.js
  17. 4
      js/src/jit-test/tests/auto-regress/bug537854.js
  18. 9
      js/src/jit-test/tests/auto-regress/bug560796.js
  19. 1
      js/src/jit-test/tests/auto-regress/bug638735.js
  20. 9
      js/src/jit-test/tests/auto-regress/bug639413.js
  21. 9
      js/src/jit-test/tests/auto-regress/bug698899.js
  22. 10
      js/src/jit-test/tests/auto-regress/bug746397.js
  23. 6
      js/src/jit-test/tests/auto-regress/bug769192.js
  24. 8
      js/src/jit-test/tests/baseline/bug843444.js
  25. 13
      js/src/jit-test/tests/basic/bug510437.js
  26. 9
      js/src/jit-test/tests/basic/bug605015.js
  27. 9
      js/src/jit-test/tests/basic/bug631305.js
  28. 6
      js/src/jit-test/tests/basic/bug662562.js
  29. 12
      js/src/jit-test/tests/basic/bug690292.js
  30. 3
      js/src/jit-test/tests/basic/bug696748.js
  31. 3
      js/src/jit-test/tests/basic/bug831846.js
  32. 7
      js/src/jit-test/tests/basic/testAssigningWatchedDeletedProperty.js
  33. 9
      js/src/jit-test/tests/basic/testBug566556.js
  34. 13
      js/src/jit-test/tests/basic/testBug578044.js
  35. 9
      js/src/jit-test/tests/basic/testBug584650.js
  36. 20
      js/src/jit-test/tests/basic/testBug780288-1.js
  37. 20
      js/src/jit-test/tests/basic/testBug780288-2.js
  38. 3
      js/src/jit-test/tests/basic/testEvalCalledFromWatchOverSetter.js
  39. 7
      js/src/jit-test/tests/basic/testNonStubGetter.js
  40. 7
      js/src/jit-test/tests/basic/testSettingWatchPointOnReadOnlyProp.js
  41. 16
      js/src/jit-test/tests/basic/testTrueShiftTrue.js
  42. 63
      js/src/jit-test/tests/basic/testWatchRecursion.js
  43. 3
      js/src/jit-test/tests/gc/bug-900405.js
  44. 5
      js/src/jit-test/tests/gc/bug-913261.js
  45. 8
      js/src/jit-test/tests/gc/bug-986864.js
  46. 8
      js/src/jit-test/tests/ion/bug1063182.js
  47. 2
      js/src/jit-test/tests/ion/bug772901.js
  48. 8
      js/src/jit-test/tests/ion/bug774257-1.js
  49. 10
      js/src/jit-test/tests/ion/bug774257-2.js
  50. 9
      js/src/jit-test/tests/ion/bug779631.js
  51. 1
      js/src/jit-test/tests/ion/bug783590.js
  52. 8
      js/src/jit-test/tests/jaeger/bug550665.js
  53. 7
      js/src/jit-test/tests/jaeger/bug557063.js
  54. 1
      js/src/jit-test/tests/jaeger/bug588338.js
  55. 10
      js/src/jit-test/tests/jaeger/bug625438.js
  56. 7
      js/src/jit-test/tests/jaeger/bug630366.js
  57. 1
      js/src/jit-test/tests/jaeger/recompile/bug641225.js
  58. 4
      js/src/jit-test/tests/pic/fuzz1.js
  59. 3
      js/src/jit-test/tests/pic/fuzz3.js
  60. 7
      js/src/jit-test/tests/pic/watch1.js
  61. 17
      js/src/jit-test/tests/pic/watch1a.js
  62. 8
      js/src/jit-test/tests/pic/watch2.js
  63. 18
      js/src/jit-test/tests/pic/watch2a.js
  64. 7
      js/src/jit-test/tests/pic/watch3.js
  65. 19
      js/src/jit-test/tests/pic/watch3a.js
  66. 20
      js/src/jit-test/tests/pic/watch3b.js
  67. 9
      js/src/jit-test/tests/pic/watch4.js
  68. 27
      js/src/jit-test/tests/pic/watch5.js
  69. 14
      js/src/jit-test/tests/profiler/bug1140643.js
  70. 19
      js/src/tests/ecma_5/Array/frozen-dense-array.js
  71. 41
      js/src/tests/ecma_5/extensions/watch-array-length.js
  72. 38
      js/src/tests/ecma_5/extensions/watch-inherited-property.js
  73. 46
      js/src/tests/ecma_5/extensions/watch-replaced-setter.js
  74. 44
      js/src/tests/ecma_5/extensions/watch-setter-become-setter.js
  75. 43
      js/src/tests/ecma_5/extensions/watch-value-prop-becoming-setter.js
  76. 56
      js/src/tests/ecma_5/extensions/watchpoint-deletes-JSPropertyOp-setter.js
  77. 41
      js/src/tests/js1_5/Object/regress-362872-01.js
  78. 24
      js/src/tests/js1_5/Object/regress-362872-02.js
  79. 75
      js/src/tests/js1_5/Regress/regress-127243.js
  80. 29
      js/src/tests/js1_5/Regress/regress-213482.js
  81. 37
      js/src/tests/js1_5/Regress/regress-240577.js
  82. 29
      js/src/tests/js1_5/Regress/regress-355341.js
  83. 49
      js/src/tests/js1_5/Regress/regress-355344.js
  84. 32
      js/src/tests/js1_5/Regress/regress-361467.js
  85. 35
      js/src/tests/js1_5/Regress/regress-361617.js
  86. 28
      js/src/tests/js1_5/Regress/regress-385393-06.js
  87. 45
      js/src/tests/js1_5/Regress/regress-506567.js
  88. 19
      js/src/tests/js1_5/extensions/regress-303277.js
  89. 32
      js/src/tests/js1_5/extensions/regress-355339.js
  90. 22
      js/src/tests/js1_5/extensions/regress-361346.js
  91. 32
      js/src/tests/js1_5/extensions/regress-361360.js
  92. 27
      js/src/tests/js1_5/extensions/regress-361552.js
  93. 19
      js/src/tests/js1_5/extensions/regress-361558.js
  94. 38
      js/src/tests/js1_5/extensions/regress-361571.js
  95. 35
      js/src/tests/js1_5/extensions/regress-361856.js
  96. 54
      js/src/tests/js1_5/extensions/regress-361964.js
  97. 38
      js/src/tests/js1_5/extensions/regress-385134.js
  98. 18
      js/src/tests/js1_5/extensions/regress-385393-09.js
  99. 42
      js/src/tests/js1_5/extensions/regress-390597.js
  100. 21
      js/src/tests/js1_5/extensions/regress-420612.js
  101. Some files were not shown because too many files have changed in this diff Show More

58
devtools/client/webconsole/test/browser_webconsole_bug_585991_autocomplete_keys.js

@ -57,8 +57,8 @@ var consoleOpened = Task.async(function* (hud) {
// 4 values, and the following properties:
// __defineGetter__ __defineSetter__ __lookupGetter__ __lookupSetter__
// __proto__ hasOwnProperty isPrototypeOf propertyIsEnumerable
// toLocaleString toString toSource unwatch valueOf watch constructor.
is(popup.itemCount, 19, "popup.itemCount is correct");
// toLocaleString toString toSource valueOfconstructor.
is(popup.itemCount, 17, "popup.itemCount is correct");
let sameItems = popup.getItems().reverse().map(function (e) {
return e.label;
@ -82,36 +82,34 @@ var consoleOpened = Task.async(function* (hud) {
"toLocaleString",
"toSource",
"toString",
"unwatch",
"valueOf",
"watch",
][index] === prop;
}), "getItems returns the items we expect");
is(popup.selectedIndex, 18,
is(popup.selectedIndex, 16,
"Index of the first item from bottom is selected.");
EventUtils.synthesizeKey("VK_DOWN", {});
let prefix = jsterm.getInputValue().replace(/[\S]/g, " ");
is(popup.selectedIndex, 0, "index 0 is selected");
is(popup.selectedItem.label, "watch", "watch is selected");
is(completeNode.value, prefix + "watch",
"completeNode.value holds watch");
is(popup.selectedItem.label, "valueOf", "valueOf is selected");
is(completeNode.value, prefix + "valueOf",
"completeNode.value holds valueOf");
EventUtils.synthesizeKey("VK_DOWN", {});
is(popup.selectedIndex, 1, "index 1 is selected");
is(popup.selectedItem.label, "valueOf", "valueOf is selected");
is(completeNode.value, prefix + "valueOf",
"completeNode.value holds valueOf");
is(popup.selectedItem.label, "toString", "toString is selected");
is(completeNode.value, prefix + "toString",
"completeNode.value holds toString");
EventUtils.synthesizeKey("VK_UP", {});
is(popup.selectedIndex, 0, "index 0 is selected");
is(popup.selectedItem.label, "watch", "watch is selected");
is(completeNode.value, prefix + "watch",
"completeNode.value holds watch");
is(popup.selectedItem.label, "valueOf", "valueOf is selected");
is(completeNode.value, prefix + "valueOf",
"completeNode.value holds valueOf");
let currentSelectionIndex = popup.selectedIndex;
@ -127,7 +125,7 @@ var consoleOpened = Task.async(function* (hud) {
"Index is less after Page UP");
EventUtils.synthesizeKey("VK_END", {});
is(popup.selectedIndex, 18, "index is last after End");
is(popup.selectedIndex, 16, "index is last after End");
EventUtils.synthesizeKey("VK_HOME", {});
is(popup.selectedIndex, 0, "index is first after Home");
@ -151,7 +149,7 @@ function popupHideAfterTab() {
// At this point the completion suggestion should be accepted.
ok(!popup.isOpen, "popup is not open");
is(jsterm.getInputValue(), "window.foobarBug585991.watch",
is(jsterm.getInputValue(), "window.foobarBug585991.valueOf",
"completion was successful after VK_TAB");
ok(!completeNode.value, "completeNode is empty");
@ -159,17 +157,17 @@ function popupHideAfterTab() {
popup.once("popup-opened", function onShown() {
ok(popup.isOpen, "popup is open");
is(popup.itemCount, 19, "popup.itemCount is correct");
is(popup.itemCount, 17, "popup.itemCount is correct");
is(popup.selectedIndex, 18, "First index from bottom is selected");
is(popup.selectedIndex, 16, "First index from bottom is selected");
EventUtils.synthesizeKey("VK_DOWN", {});
let prefix = jsterm.getInputValue().replace(/[\S]/g, " ");
is(popup.selectedIndex, 0, "index 0 is selected");
is(popup.selectedItem.label, "watch", "watch is selected");
is(completeNode.value, prefix + "watch",
"completeNode.value holds watch");
is(popup.selectedItem.label, "valueOf", "valueOf is selected");
is(completeNode.value, prefix + "valueOf",
"completeNode.value holds valueOf");
popup.once("popup-closed", function onHidden() {
ok(!popup.isOpen, "popup is not open after VK_ESCAPE");
@ -203,29 +201,29 @@ function testReturnKey() {
popup.once("popup-opened", function onShown() {
ok(popup.isOpen, "popup is open");
is(popup.itemCount, 19, "popup.itemCount is correct");
is(popup.itemCount, 17, "popup.itemCount is correct");
is(popup.selectedIndex, 18, "First index from bottom is selected");
is(popup.selectedIndex, 16, "First index from bottom is selected");
EventUtils.synthesizeKey("VK_DOWN", {});
let prefix = jsterm.getInputValue().replace(/[\S]/g, " ");
is(popup.selectedIndex, 0, "index 0 is selected");
is(popup.selectedItem.label, "watch", "watch is selected");
is(completeNode.value, prefix + "watch",
"completeNode.value holds watch");
is(popup.selectedItem.label, "valueOf", "valueOf is selected");
is(completeNode.value, prefix + "valueOf",
"completeNode.value holds valueOf");
EventUtils.synthesizeKey("VK_DOWN", {});
is(popup.selectedIndex, 1, "index 1 is selected");
is(popup.selectedItem.label, "valueOf", "valueOf is selected");
is(completeNode.value, prefix + "valueOf",
"completeNode.value holds valueOf");
is(popup.selectedItem.label, "toString", "toString is selected");
is(completeNode.value, prefix + "toString",
"completeNode.value holds toString");
popup.once("popup-closed", function onHidden() {
ok(!popup.isOpen, "popup is not open after VK_RETURN");
is(jsterm.getInputValue(), "window.foobarBug585991.valueOf",
is(jsterm.getInputValue(), "window.foobarBug585991.toString",
"completion was successful after VK_RETURN");
ok(!completeNode.value, "completeNode is empty");

6
dom/bindings/test/test_Object.prototype_props.html

@ -11,9 +11,9 @@ test(function() {
// Codegen.py's CGDictionary.getMemberDefinition method.
var expected = [
"constructor", "toSource", "toString", "toLocaleString", "valueOf",
"watch", "unwatch", "hasOwnProperty", "isPrototypeOf",
"propertyIsEnumerable", "__defineGetter__", "__defineSetter__",
"__lookupGetter__", "__lookupSetter__", "__proto__"
"hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable",
"__defineGetter__", "__defineSetter__", "__lookupGetter__",
"__lookupSetter__", "__proto__"
];
assert_array_equals(props.sort(), expected.sort());
}, "Own properties of Object.prototype");

1
dom/html/test/mochitest.ini

@ -553,7 +553,6 @@ skip-if = true # Disabled for timeouts.
[test_viewport.html]
[test_documentAll.html]
[test_document-element-inserted.html]
[test_document.watch.html]
[test_bug445004.html]
skip-if = true || toolkit == 'android' # Disabled permanently (bug 559932).
[test_bug446483.html]

129
dom/html/test/test_document.watch.html

@ -1,129 +0,0 @@
<!DOCTYPE html>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=903332
-->
<head>
<meta charset="utf-8">
<title>Test for Bug 903332</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript">
/** Test for Bug 903332 **/
var watch1Called;
function watch1(prop, oldValue, newValue)
{
is(watch1Called, false, "watch1Called not reset properly?");
watch1Called = true;
is(prop, "cookie", "wrong property name passed to watch1");
return newValue;
}
var watch2Called;
function watch2(prop, oldValue, newValue)
{
is(watch2Called, false, "watch2Called not reset properly?");
watch2Called = true;
is(prop, "cookie", "wrong property name passed to watch2");
return newValue;
}
// Just in case subsequent tests depend on a particular value...
var originalValue = document.cookie;
ok(true, "originalValue: " + originalValue);
var originalPrefix = originalValue.length > 0 ? originalValue + "; " : "";
try
{
// trial set (no watch) to verify things work
document.cookie = "first=set";
is(document.cookie, originalPrefix + "first=set",
"first value correct");
// add a watch
document.watch("cookie", watch1);
// set, check for watch invoked
watch1Called = false;
document.cookie = "second=set";
is(watch1Called, true, "watch1 function should be called");
is(document.cookie, originalPrefix + "first=set; second=set",
"second value correct");
// and a second time, just in case
watch1Called = false;
document.cookie = "third=set";
is(watch1Called, true, "watch1 function should be called");
is(document.cookie, originalPrefix + "first=set; second=set; third=set",
"third value correct");
// overwrite the current watch with a new one
document.watch("cookie", watch2);
// set, check for watch invoked
watch1Called = false;
watch2Called = false;
document.cookie = "fourth=set";
is(watch1Called, false, "watch1 invoked erroneously");
is(watch2Called, true, "watch2 function should be called");
is(document.cookie, originalPrefix + "first=set; second=set; third=set; fourth=set",
"fourth value correct");
// and a second time, just in case
watch1Called = false;
watch2Called = false;
document.cookie = "fifth=set";
is(watch1Called, false, "watch1 invoked erroneously");
is(watch2Called, true, "watch2 function should be called");
is(document.cookie, originalPrefix + "first=set; second=set; third=set; fourth=set; fifth=set",
"fifth value correct");
// remove the watch
document.unwatch("cookie");
// check for non-invocation now
watch1Called = false;
watch2Called = false;
document.cookie = "sixth=set";
is(watch1Called, false, "watch1 shouldn't be called");
is(watch2Called, false, "watch2 shouldn't be called");
is(document.cookie, originalPrefix + "first=set; second=set; third=set; fourth=set; fifth=set; sixth=set",
"sixth value correct");
}
finally
{
// reset
document.unwatch("cookie"); // harmless, should be no-op except if bugs
var d = new Date();
d.setTime(0);
var suffix = "=; expires=" + d.toGMTString();
document.cookie = "first" + suffix;
document.cookie = "second" + suffix;
document.cookie = "third" + suffix;
document.cookie = "fourth" + suffix;
document.cookie = "fifth" + suffix;
document.cookie = "sixth" + suffix;
}
is(document.cookie, originalValue,
"document.cookie isn't what it was initially! expect bustage further " +
"down the line");
</script>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=903332">Mozilla Bug 903332</a>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
</pre>
</body>
</html>

15
dom/svg/crashtests/880544-1.svg

@ -1,15 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg">
<script>//<![CDATA[
function add_watch()
{
document.getElementById("p").transform.baseVal.watch("0", function(){});
}
window.addEventListener("load", add_watch, false);
//]]></script>
<path id="p" transform="scale(1)" />
</svg>

Before

Width:  |  Height:  |  Size: 282 B

15
dom/svg/crashtests/880544-2.svg

@ -1,15 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg">
<script>//<![CDATA[
function add_watch()
{
document.getElementById("e").x.baseVal.watch("0", function(){});
}
window.addEventListener("load", add_watch, false);
//]]></script>
<text id="e" x="10">foo</text>
</svg>

Before

Width:  |  Height:  |  Size: 268 B

15
dom/svg/crashtests/880544-3.svg

@ -1,15 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg">
<script>//<![CDATA[
function add_watch()
{
document.getElementById("e").rotate.baseVal.watch("0", function(){});
}
window.addEventListener("load", add_watch, false);
//]]></script>
<text id="e" rotate="10">foo</text>
</svg>

Before

Width:  |  Height:  |  Size: 278 B

15
dom/svg/crashtests/880544-4.svg

@ -1,15 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg">
<script>//<![CDATA[
function add_watch()
{
document.getElementById("e").pathSegList.watch("0", function(){});
}
window.addEventListener("load", add_watch, false);
//]]></script>
<path id="e" d="M0,0"/>
</svg>

Before

Width:  |  Height:  |  Size: 263 B

15
dom/svg/crashtests/880544-5.svg

@ -1,15 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg">
<script>//<![CDATA[
function add_watch()
{
document.getElementById("e").points.watch("0", function(){});
}
window.addEventListener("load", add_watch, false);
//]]></script>
<polygon id="e" points="0,0"/>
</svg>

Before

Width:  |  Height:  |  Size: 265 B

5
dom/svg/crashtests/crashtests.list

@ -66,11 +66,6 @@ load 837450-1.svg
load 842463-1.html
load 847138-1.svg
load 864509.svg
load 880544-1.svg
load 880544-2.svg
load 880544-3.svg
load 880544-4.svg
load 880544-5.svg
load 898915-1.svg
load 1035248-1.svg
load 1035248-2.svg

14
dom/tests/mochitest/bugs/iframe_bug38959-1.html

@ -1,14 +0,0 @@
<html>
<head>
<title>Iframe test for bug 38959</title>
</head>
<body">
<script>
x = false;
window.opener.postMessage(1, "http://mochi.test:8888");
window.close();
</script>
</body>
</html>

14
dom/tests/mochitest/bugs/iframe_bug38959-2.html

@ -1,14 +0,0 @@
<html>
<head>
<title>Iframe test for bug 38959</title>
</head>
<body">
<script>
x = true;
window.opener.postMessage(2, "http://mochi.test:8888");
window.close();
</script>
</body>
</html>

3
dom/tests/mochitest/bugs/mochitest.ini

@ -23,8 +23,6 @@ support-files =
grandchild_bug260264.html
iframe_bug304459-1.html
iframe_bug304459-2.html
iframe_bug38959-1.html
iframe_bug38959-2.html
iframe_bug430276-2.html
iframe_bug430276.html
iframe_bug440572.html
@ -64,7 +62,6 @@ skip-if = toolkit == 'android' #TIMED_OUT
[test_bug377539.html]
[test_bug384122.html]
[test_bug389366.html]
[test_bug38959.html]
[test_bug393974.html]
[test_bug394769.html]
[test_bug396843.html]

57
dom/tests/mochitest/bugs/test_bug38959.html

@ -1,57 +0,0 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=38959
-->
<head>
<title>Test for Bug 38959</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=38959">Mozilla Bug 38959</a>
<p id="display"></p>
<div id="content" style="display: none">
<iframe id="frame"></iframe>
</div>
<pre id="test">
<script type="application/javascript">
/** Test for Bug 38959 **/
var newValue;
function watcher(id, ol, ne)
{
newValue = ne;
return ne;
}
function openWindow(url, crossOrigin)
{
newValue = true;
var w = window.open(url);
w.watch("x", watcher);
}
function receiveMessage(evt)
{
ok(newValue, "Watchpoints only allowed same-origin.");
if (evt.data == 1) {
openWindow("/tests/dom/tests/mochitest/bugs/iframe_bug38959-2.html");
}
else {
SimpleTest.finish();
}
}
SimpleTest.waitForExplicitFinish();
window.addEventListener("message", receiveMessage, false);
openWindow("http://example.org/tests/dom/tests/mochitest/bugs/iframe_bug38959-1.html");
</script>
</pre>
</body>
</html>

8
js/src/jit-test/tests/auto-regress/bug466654.js

@ -1,8 +0,0 @@
// |jit-test| error:TypeError
// Binary: cache/js-dbg-32-29add08d84ae-linux
// Flags: -j
//
this.watch('y', /x/g );
for each (y in ['q', 'q', 'q']) continue;
gc();

6
js/src/jit-test/tests/auto-regress/bug516897.js

@ -1,6 +0,0 @@
// Binary: cache/js-dbg-64-38754465ffde-linux
// Flags:
//
this.__defineSetter__("x", gc);
this.watch("x",function(){return});
x = 3;

4
js/src/jit-test/tests/auto-regress/bug537854.js

@ -1,4 +0,0 @@
// Binary: cache/js-dbg-64-9d51f2a931f7-linux
// Flags:
//
({x:function(){}}).watch('x',function(){});

9
js/src/jit-test/tests/auto-regress/bug560796.js

@ -1,9 +0,0 @@
// Binary: cache/js-dbg-64-a6d7a5677b4c-linux
// Flags:
//
this.__defineSetter__("x", function(){})
this.watch("x", "".localeCompare)
window = x
Object.defineProperty(this, "x", ({
set: window
}))

1
js/src/jit-test/tests/auto-regress/bug638735.js

@ -4,7 +4,6 @@
var o9 = Function.prototype;
var o13 = Array;
function f5(o) {
o.watch('p3', function() {});
ox1 = new Proxy(o, {});
}
f5(o9);

9
js/src/jit-test/tests/auto-regress/bug639413.js

@ -1,9 +0,0 @@
// |jit-test| error:TypeError
// Binary: cache/js-dbg-32-1c8e91b2e3a4-linux
// Flags:
//
a = evalcx("lazy");
a.watch("x", function() {});
({}).watch("x", function() {});
a.__defineGetter__("y", {});

9
js/src/jit-test/tests/auto-regress/bug698899.js

@ -1,9 +0,0 @@
// Binary: cache/js-dbg-32-f951e9151626-linux
// Flags: -m -n
//
o = evalcx("lazy").__proto__
gc()
try {
o.watch()
} catch (e) {}
o.constructor()

10
js/src/jit-test/tests/auto-regress/bug746397.js

@ -1,10 +0,0 @@
// |jit-test| error:ReferenceError
// Binary: cache/js-dbg-64-67bf9a4a1f77-linux
// Flags: --ion-eager
//
(function () {
var a = ['x', 'y'];
obj.watch(a[+("0")], counter);
})();

6
js/src/jit-test/tests/auto-regress/bug769192.js

@ -1,6 +0,0 @@
// |jit-test| error:TypeError
// Binary: cache/js-dbg-64-bf8f2961d0cc-linux
// Flags:
//
Object.watch.call(new Uint8ClampedArray, "length", function() {});

8
js/src/jit-test/tests/baseline/bug843444.js

@ -1,8 +0,0 @@
gczeal(8, 1)
function recurse(x) {
recurse;
if (x < 20)
recurse(x + 1);
};
this.watch(5, (function () {}))
recurse(0)

13
js/src/jit-test/tests/basic/bug510437.js

@ -1,13 +0,0 @@
// Don't crash or assert.
var d;
this.watch("d", eval);
(function () {
(eval("\
(function () {\
for (let x = 0; x < 2; ++x) {\
d = x\
}\
})\
"))()
})()

9
js/src/jit-test/tests/basic/bug605015.js

@ -1,9 +0,0 @@
// |jit-test| error: TypeError
// don't assert
print(this.watch("x",
function() {
Object.defineProperty(this, "x", ({
get: (Int8Array)
}))
}))(x = /x/)

9
js/src/jit-test/tests/basic/bug631305.js

@ -1,9 +0,0 @@
var n = 0;
var a = [];
for (var i = 0; i < 20; i++)
a[i] = {};
a[18].watch("p", function () { n++; });
delete a[18].p;
for (var i = 0; i < 20; i++)
a[i].p = 0;
assertEq(n, 1);

6
js/src/jit-test/tests/basic/bug662562.js

@ -1,6 +0,0 @@
// |jit-test| error: TypeError
function f(o) {
o.watch("x", this);
}
var c = evalcx("");
f(c);

12
js/src/jit-test/tests/basic/bug690292.js

@ -1,12 +0,0 @@
done = false;
try {
function x() {}
print(this.watch("d", Object.create))
var d = {}
} catch (e) {}
try {
eval("d = ''")
done = true;
} catch (e) {}
assertEq(done, false);

3
js/src/jit-test/tests/basic/bug696748.js

@ -1,6 +1,3 @@
try {
this.watch("b", "".substring);
} catch(exc1) {}
eval("\
var URI = '';\
test();\

3
js/src/jit-test/tests/basic/bug831846.js

@ -1,3 +0,0 @@
// |jit-test| error:TypeError
evalcx('').watch("", /()/);

7
js/src/jit-test/tests/basic/testAssigningWatchedDeletedProperty.js

@ -1,7 +0,0 @@
var o = {};
o.watch("p", function() { });
for (var i = 0; i < 10; i++) {
o.p = 123;
delete o.p;
}

9
js/src/jit-test/tests/basic/testBug566556.js

@ -1,9 +0,0 @@
var msg = "";
try {
this.__defineSetter__('x', Object.create);
this.watch('x', function() {});
x = 3;
} catch (e) {
msg = e.toString();
}
assertEq(msg, "TypeError: undefined is not an object or null");

13
js/src/jit-test/tests/basic/testBug578044.js

@ -1,13 +0,0 @@
this.watch("x", Object.create)
try {
(function() {
this.__defineGetter__("x",
function() {
return this
})
})()
} catch(e) {}
Object.defineProperty(x, "x", ({
set: Uint16Array
}))

9
js/src/jit-test/tests/basic/testBug584650.js

@ -1,9 +0,0 @@
if (typeof gczeal != "function")
gczeal = function() {}
// don't crash
x = (evalcx('lazy'))
x.watch("", function () {})
gczeal(1)
for (w in x) {}

20
js/src/jit-test/tests/basic/testBug780288-1.js

@ -1,20 +0,0 @@
s = newGlobal()
try {
evalcx("\
Object.defineProperty(this,\"i\",{enumerable:true,get:function(){t}});\
for each(y in this)true\
", s)
} catch (e) {}
try {
evalcx("\
for(z=0,(7).watch(\"\",eval);;g){\
if(z=1){({t:function(){}})\
}\
", s)
} catch (e) {}
try {
evalcx("\
Object.defineProperty(this,\"g2\",{get:function(){return this}});\
g2.y()\
", s)
} catch (e) {}

20
js/src/jit-test/tests/basic/testBug780288-2.js

@ -1,20 +0,0 @@
s = newGlobal()
try {
evalcx("\
Object.defineProperty(this,\"i\",{enumerable:true,get:function(){t}});\
for each(y in this)true\
", s)
} catch (e) {}
try {
evalcx("\
for(z=0,(7).watch(\"\",eval);;g){\
if(z=1){({t:function(){}})\
}\
", s)
} catch (e) {}
try {
evalcx("\
Object.defineProperty(this,\"g2\",{get:function(){return this}});\
g2.y(\"\")\
", s)
} catch (e) {}

3
js/src/jit-test/tests/basic/testEvalCalledFromWatchOverSetter.js

@ -1,3 +0,0 @@
this.__defineSetter__("x", function(){});
this.watch("x", eval);
x = 0;

7
js/src/jit-test/tests/basic/testNonStubGetter.js

@ -1,7 +0,0 @@
function testNonStubGetter() {
{ let [] = []; (this.watch("x", function(p, o, n) { return /a/g.exec(p, o, n); })); };
(function () { (eval("(function(){for each (x in [1, 2, 2]);});"))(); })();
this.unwatch("x");
return "ok";
}
assertEq(testNonStubGetter(), "ok");

7
js/src/jit-test/tests/basic/testSettingWatchPointOnReadOnlyProp.js

@ -1,7 +0,0 @@
for (var i = 0; i < 5; ++i) {
var o = {}
Object.defineProperty(o, 'x', { value:"cow", writable:false });
var r = o.watch('x', function() {});
assertEq(r, undefined);
o.x = 4;
}

16
js/src/jit-test/tests/basic/testTrueShiftTrue.js

@ -1,16 +0,0 @@
// Test no assert or crash from outer recorders (bug 465145)
function testBug465145() {
this.__defineSetter__("x", function(){});
this.watch("x", function(){});
y = this;
for (var z = 0; z < 2; ++z) { x = y };
this.__defineSetter__("x", function(){});
for (var z = 0; z < 2; ++z) { x = y };
}
function testTrueShiftTrue() {
var a = new Array(5);
for (var i=0;i<5;++i) a[i] = "" + (true << true);
return a.join(",");
}
assertEq(testTrueShiftTrue(), "2,2,2,2,2");

63
js/src/jit-test/tests/basic/testWatchRecursion.js

@ -1,63 +0,0 @@
// Test that the watch handler is not called recursively for the same object
// and property.
(function() {
var obj1 = {}, obj2 = {};
var handler_entry_count = 0;
var handler_exit_count = 0;
obj1.watch('x', handler);
obj1.watch('y', handler);
obj2.watch('x', handler);
obj1.x = 1;
assertEq(handler_entry_count, 3);
assertEq(handler_exit_count, 3);
function handler(id) {
handler_entry_count++;
assertEq(handler_exit_count, 0);
switch (true) {
case this === obj1 && id === "x":
assertEq(handler_entry_count, 1);
obj2.x = 3;
assertEq(handler_exit_count, 2);
break;
case this === obj2 && id === "x":
assertEq(handler_entry_count, 2);
obj1.y = 4;
assertEq(handler_exit_count, 1);
break;
default:
assertEq(this, obj1);
assertEq(id, "y");
assertEq(handler_entry_count, 3);
// We expect no more watch handler invocations
obj1.x = 5;
obj1.y = 6;
obj2.x = 7;
assertEq(handler_exit_count, 0);
break;
}
++handler_exit_count;
assertEq(handler_entry_count, 3);
}
})();
// Test that run-away recursion in watch handlers is properly handled.
(function() {
var obj = {};
var i = 0;
try {
handler();
throw new Error("Unreachable");
} catch(e) {
assertEq(e instanceof InternalError, true);
}
function handler() {
var prop = "a" + ++i;
obj.watch(prop, handler);
obj[prop] = 2;
}
})();

3
js/src/jit-test/tests/gc/bug-900405.js

@ -1,3 +0,0 @@
(function() {
[{ "9": [] }.watch([], function(){})]
})()

5
js/src/jit-test/tests/gc/bug-913261.js

@ -1,5 +0,0 @@
// |jit-test| error: InternalError: too much recursion
(function f() {
"".watch(2, function() {});
f();
})()

8
js/src/jit-test/tests/gc/bug-986864.js

@ -1,8 +0,0 @@
// |jit-test| slow
function x() {}
for (var j = 0; j < 9999; ++j) {
(function() {
x += x.watch("endsWith", ArrayBuffer);
return 0 >> Function(x)
})()
}

8
js/src/jit-test/tests/ion/bug1063182.js

@ -1,8 +0,0 @@
// |jit-test| error: ReferenceError
eval("(function() { " + "\
var o = {};\
o.watch('p', function() { });\
for (var i = 0; i < 10; \u5ede ++)\
o.p = 123;\
" + " })();");

2
js/src/jit-test/tests/ion/bug772901.js

@ -4,4 +4,4 @@ function f(x) {
delete ((x)++);
arguments[0] !== undefined;
}
f(1, x = [f.ArrayBuffer,unwatch.Int32Array], this, this, this) ;
f(1, x = [f.ArrayBuffer, undefined], this, this, this) ;

8
js/src/jit-test/tests/ion/bug774257-1.js

@ -1,8 +0,0 @@
Object.defineProperty(Object.prototype, 'x', {
set: function() { evalcx('lazy'); }
});
var obj = {};
obj.watch("x", function (id, oldval, newval) {});
for (var str in 'A') {
obj.x = 1;
}

10
js/src/jit-test/tests/ion/bug774257-2.js

@ -1,10 +0,0 @@
Object.defineProperty(Object.prototype, 'x', {
set: function() { evalcx('lazy'); }
});
var obj = {};
var prot = {};
obj.__proto__ = prot;
obj.watch("x", function (id, oldval, newval) {});
for (var str in 'A') {
obj.x = 1;
}

9
js/src/jit-test/tests/ion/bug779631.js

@ -1,9 +0,0 @@
var flag = 0;
var a = {};
Object.defineProperty(a, "value", {set: function(x) {}});
a.watch("value", function(){flag++;});
for(var i = 0; i < 100; i++) {
a.value = i;
assertEq(flag, i+1);
}

1
js/src/jit-test/tests/ion/bug783590.js

@ -7,7 +7,6 @@ Object.defineProperty(arr, 0, {
glob.__proto__;
})
});
this.watch("s", function() {});
try {
arr.pop();
} catch (e) {}

8
js/src/jit-test/tests/jaeger/bug550665.js

@ -1,8 +0,0 @@
(function () {
var a;
eval("for(w in ((function(x,y){b:0})())) ;");
})();
this.__defineSetter__("l", function() { gc() });
this.watch("l", function(x) { yield {} });
l = true;

7
js/src/jit-test/tests/jaeger/bug557063.js

@ -1,7 +0,0 @@
(function() {
for (a = 0; a < 2; a++)
''.watch("", function() {})
})()
/* Don't crash or assert. */

1
js/src/jit-test/tests/jaeger/bug588338.js

@ -9,7 +9,6 @@ function f() {
}
}
})(/x/)))
for (z = 0; z < 100; x.unwatch(), z++)
for (e in [0]) {
gczeal(2)
} ( [1,2,3])("")

10
js/src/jit-test/tests/jaeger/bug625438.js

@ -1,10 +0,0 @@
// vim: set ts=8 sts=4 et sw=4 tw=99:
var count = 0;
this.watch("x", function() {
count++;
});
for(var i=0; i<10; i++) {
x = 2;
}
assertEq(count, 10);

7
js/src/jit-test/tests/jaeger/bug630366.js

@ -1,7 +0,0 @@
var o = {};
for(var i=0; i<5; i++) {
o.p = 2;
o.watch("p", function() { });
o.p = 2;
delete o.p;
}

1
js/src/jit-test/tests/jaeger/recompile/bug641225.js

@ -118,7 +118,6 @@ for(var o2 in f5) {
f2(o5);
f2(o5);
f0(o3);
o9.watch('p3', function() {});
o8[o8] = o8;
f0(o5);
f1(o6);

4
js/src/jit-test/tests/pic/fuzz1.js

@ -1,4 +0,0 @@
(function() {
for (a = 0; a < 2; a++)
''.watch("", function() {})
})()

3
js/src/jit-test/tests/pic/fuzz3.js

@ -1,3 +0,0 @@
for each(let w in [[], 0, [], 0]) {
w.unwatch()
}

7
js/src/jit-test/tests/pic/watch1.js

@ -1,7 +0,0 @@
// assignments to watched objects must not be cached
var obj = {x: 0};
var hits = 0;
obj.watch("x", function (id, oldval, newval) { hits++; return newval; });
for (var i = 0; i < 10; i++)
obj.x = i;
assertEq(hits, 10);

17
js/src/jit-test/tests/pic/watch1a.js

@ -1,17 +0,0 @@
// assignments to watched objects must not be traced
var hits = 0;
function counter(id, oldval, newval) {
hits++;
return newval;
}
(function () {
var obj = {x: 0, y: 0};
var a = ['x', 'y'];
obj.watch('z', counter);
for (var i = 0; i < 14; i++) {
obj.watch(a[+(i > 8)], counter);
obj.y = i;
}
})();
assertEq(hits, 5);

8
js/src/jit-test/tests/pic/watch2.js

@ -1,8 +0,0 @@
// assignments to watched properties via ++ must not be cached
var obj = {x: 0};
var hits = 0;
obj.watch("x", function (id, oldval, newval) { hits++; return newval; });
for (var i = 0; i < 10; i++)
obj.x++;
assertEq(hits, 10);

18
js/src/jit-test/tests/pic/watch2a.js

@ -1,18 +0,0 @@
// assignments to watched properties via ++ must not be traced
var hits = 0;
function counter(id, oldval, newval) {
hits++;
return newval;
}
(function () {
var obj = {x: 0, y: 0};
var a = ['x', 'y'];
obj.watch('z', counter);
for (var i = 0; i < 14; i++) {
obj.watch(a[+(i > 8)], counter);
obj.y++;
}
})();
assertEq(hits, 5);

7
js/src/jit-test/tests/pic/watch3.js

@ -1,7 +0,0 @@
// assignment to watched global properties must not be cached
x = 0;
var hits = 0;
this.watch("x", function (id, oldval, newval) { hits++; return newval; });
for (var i = 0; i < 10; i++)
x = i;
assertEq(hits, 10);

19
js/src/jit-test/tests/pic/watch3a.js

@ -1,19 +0,0 @@
// assignment to watched global properties must not be traced
var hits = 0;
function counter(id, oldval, newval) {
hits++;
return newval;
}
var x = 0;
var y = 0;
(function () {
var a = ['x', 'y'];
this.watch('z', counter);
for (var i = 0; i < 14; i++) {
this.watch(a[+(i > 8)], counter);
y = 1;
}
})();
assertEq(hits, 5);

20
js/src/jit-test/tests/pic/watch3b.js

@ -1,20 +0,0 @@
// assignment to watched global properties must not be traced
var hits = 0;
function counter(id, oldval, newval) {
hits++;
return newval;
}
var x = 0;
var y = 0;
function f() {
var a = [{}, this];
for (var i = 0; i < 14; i++) {
print(shapeOf(this));
Object.prototype.watch.call(a[+(i > 8)], "y", counter);
y++;
}
}
f();
assertEq(hits, 5);

9
js/src/jit-test/tests/pic/watch4.js

@ -1,9 +0,0 @@
// adding assignment + watchpoint vs. caching
var hits = 0;
var obj = {};
obj.watch("x", function (id, oldval, newval) { hits++; return newval; });
for (var i = 0; i < 10; i++) {
obj.x = 1;
delete obj.x;
}
assertEq(hits, 10);

27
js/src/jit-test/tests/pic/watch5.js

@ -1,27 +0,0 @@
// test against future pic support for symbols
// assignments to watched objects must not be cached
var obj = {};
var x = Symbol.for("x");
obj[x] = 0;
var hits = 0;
obj.watch(x, function (id, oldval, newval) { hits++; return newval; });
for (var i = 0; i < 10; i++)
obj[x] = i;
assertEq(hits, 10);
// assignments to watched properties via ++ must not be cached
hits = 0;
for (var i = 0; i < 10; i++)
obj[x]++;
assertEq(hits, 10);
// adding assignment + watchpoint vs. caching
hits = 0;
obj = {};
obj.watch(x, function (id, oldval, newval) { hits++; return newval; });
for (var i = 0; i < 10; i++) {
obj[x] = 1;
delete obj[x];
}
assertEq(hits, 10);

14
js/src/jit-test/tests/profiler/bug1140643.js

@ -1,14 +0,0 @@
// |jit-test| allow-oom
enableSPSProfiling();
loadFile('\
for (var i = 0; i < 2; i++) {\
obj = { m: function () {} };\
obj.watch("m", function () { float32 = 0 + obj.foo; });\
obj.m = 0;\
}\
');
gcparam("maxBytes", gcparam("gcBytes") + (1)*1024);
newGlobal("same-compartment");
function loadFile(lfVarx) {
evaluate(lfVarx, { noScriptRval : true, isRunOnce : true });
}

19
js/src/tests/ecma_5/Array/frozen-dense-array.js

@ -38,24 +38,5 @@ assertEq(delete a[0], false);
assertArrayIsExpected();
var watchpointCalled = false;
// NOTE: Be careful with the position of this test, since this sparsifies the
// elements and you might not test what you think you're testing otherwise.
a.watch(2, function(prop, oldValue, newValue) {
watchpointCalled = true;
assertEq(prop, 2);
assertEq(oldValue, 1);
assertEq(newValue, "foo");
});
assertArrayIsExpected();
a.length = 5;
a[2] = "foo";
assertEq(watchpointCalled, true);
assertEq(delete a[0], false);
assertArrayIsExpected();
if (typeof reportCompare === "function")