summaryrefslogtreecommitdiffstats
path: root/ppapi
diff options
context:
space:
mode:
authordmichael@chromium.org <dmichael@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-11 20:58:03 +0000
committerdmichael@chromium.org <dmichael@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-11 20:58:03 +0000
commit72876e120f3fc6d2e51261d59c3c5e2c6f5ce4c1 (patch)
treeda1e5b1c17241ff70786552dcbd6896f2a284b8a /ppapi
parent2a3aa7b56211437d70787ebe9da514d288957d5f (diff)
downloadchromium_src-72876e120f3fc6d2e51261d59c3c5e2c6f5ce4c1.zip
chromium_src-72876e120f3fc6d2e51261d59c3c5e2c6f5ce4c1.tar.gz
chromium_src-72876e120f3fc6d2e51261d59c3c5e2c6f5ce4c1.tar.bz2
PPAPI/NaCl: Change "Bad DispatchEvent called!" logs to test failures.
Right now we see "Bad DispatchEvent called!" in the test HTML when running NaCl tests. This CL changes them to test failures because: -They're irritating. -They don't actually cause the tests to fail (though this change won't either for dispatchEvent, since we want to ignore this failure until the associated bug is fixed). -They apparently have a measurable effect on the run time of the tests! I noticed this while trying to deflake the tests locally on Windows. Prior to this change, GLibc tests still fail locally when run with sharding_supervisor.py. It's measurably slow because (I think): Each dispatchEvent invocation comes via a synchronous ExecuteScript IPC from the NaCl trusted plugin. By adding text to the page, I think we're forcing a re-layout + repaint, which leaves the NaCl plugin blocked for longer and unable to do more useful stuff. I timed the tests on Linux and got: Sharded, without this change: real 3m34.856s user 4m57.680s sys 1m5.850s Sharded, with this change: real 3m21.548s user 4m49.340s sys 1m2.320s Unsharded, without this change: real 19m21.004s user 3m43.530s sys 0m50.640s Unsharded, with this change: real 18m39.285s user 3m44.310s sys 0m52.210s (I made sure the cache was warmed up first) It's small, but note that the time saved is *only* while loading the NaCl plugin, not while actually running tests. Hence it's surprising it's not completely outweighed by the time to run the tests, and it makes sense that this affects the tests' flakiness. BUG=162094 Review URL: https://codereview.chromium.org/11823066 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@176431 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r--ppapi/tests/test_case.html23
1 files changed, 10 insertions, 13 deletions
diff --git a/ppapi/tests/test_case.html b/ppapi/tests/test_case.html
index 20dc9c7..0548476 100644
--- a/ppapi/tests/test_case.html
+++ b/ppapi/tests/test_case.html
@@ -209,7 +209,6 @@ function handleTestingMessage(message_event) {
}
function sendProgress() {
- LogHTML("...");
// We send "..." to signal that we're still working. See
// ppapi/tests/testing_instance.h for how this works.
sendAutomationMessage("...");
@@ -280,8 +279,11 @@ onload = function() {
// below.
var original = obj.dispatchEvent;
obj.dispatchEvent = function() {
- LogHTML("<p>Bad dispatchEvent called! " +
- "see <a href='http://crbug.com/109775'>crbug.com/109775</a>)");
+ // TODO(dmichael): NaCl triggers this; take out the special case for NaCl
+ // when crbug.com/109775 is fixed.
+ if (mode.indexOf("nacl") !== 0)
+ InternalError("Bad dispatchEvent called!");
+
// Pass it on anyways, we need the event to detect load progress and
// errors.
return original.apply(obj, arguments);
@@ -296,21 +298,16 @@ onload = function() {
// particular, we replace document.createEvent, MessageEvent.initMessageEvent,
// and the MessageEvent constructor. Previous versions of the PostMessage
// implementation made use of these and would fail (http://crbug.com/82604).
-// The NaCl plugin uses some of these still for progress events, hence you will
-// see:
-// Bad dispatchEvent called!
-// in the output. See crbug.com/109775 for more information.
-// TODO(dmichael): Once the NaCl plugin progress events are fixed, we should
-// clear the PASS cookie so that browser_tests sees these as a
-// failure (see ConditionFailed for how to do this).
+// The NaCl plugin uses dispatchEvent for progress events, hence we are careful
+// to make that still pass for NaCl (see above, and see crbug.com/109775).
document.createEvent = function() {
- LogHTML("<p>Bad document.createEvent called!");
+ InternalError("Bad document.createEvent called!");
}
function MessageEvent() {
- LogHTML("<p>Bad MessageEvent constructor called!");
+ InternalError("Bad MessageEvent constructor called!");
}
MessageEvent.prototype.initMessageEvent = function() {
- LogHTML("<p>Bad MessageEvent.initMessageEvent called!");
+ InternalError("Bad MessageEvent.initMessageEvent called!");
}
</script>