Index: content/test/data/media/webrtc_test_utilities.js |
diff --git a/content/test/data/media/webrtc_test_utilities.js b/content/test/data/media/webrtc_test_utilities.js |
index 5fd38113882b7c6bf7f9db219850291da9e4d2c6..9b93e4e52f5ee7e037af2c0e489c356d4ec2bdd2 100644 |
--- a/content/test/data/media/webrtc_test_utilities.js |
+++ b/content/test/data/media/webrtc_test_utilities.js |
@@ -26,7 +26,14 @@ function setAllEventsOccuredHandler(handler) { |
// Tells the C++ code we succeeded, which will generally exit the test. |
function reportTestSuccess() { |
- window.domAutomationController.send('OK'); |
+// If a test is reported to succeed and later a crash occurs |
phoglund_chromium
2015/04/10 09:47:58
Well, it's not "in the scope of the timer", it's r
perkj_chrome
2015/04/10 09:57:29
Done.
|
+// after the reporting JavaScript has completed, the test will pass. |
+// By completing the test in the scope of a timer, the reporting |
+// JavaScript will finish and if that leads to a crash, it happens |
+// before the test is reported to pass. |
+ setTimeout(function () { |
+ window.domAutomationController.send('OK'); |
+ }, 0); |
} |
// Returns a custom return value to the test. |
@@ -228,4 +235,4 @@ function hasVideoInputDeviceOnSystem() { |
else |
sendValueToTest('no-video-input-devices'); |
}); |
-} |
+} |