Commit d0f18205 authored by philipj@opera.com's avatar philipj@opera.com

Make w3cwrapper.js's done() match the semantics in testharness.js

This should fix any tests where done() can be called multiple times.

BUG=333880

Review URL: https://codereview.chromium.org/205893003

git-svn-id: svn://svn.chromium.org/blink/trunk@169720 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent f336437a
......@@ -7,7 +7,7 @@ function getAudioURI(dummy) {
return "../../../content/test.wav";
}
function testStep(testFunction){
function testStep(testFunction) {
try {
testFunction();
} catch (e) {
......@@ -15,6 +15,15 @@ function testStep(testFunction){
}
}
function testDone() {
// Match the semantics of testharness.js done(), where nothing that
// happens after that call has any effect on the test result.
if (!window.wasFinishJSTestCalled) {
finishJSTest();
assert_equals = assert_true = assert_false = function() { };
}
}
function test(testFunction) {
description(document.title);
testStep(testFunction);
......@@ -25,7 +34,7 @@ function async_test(title, options) {
description(title);
return {
step: testStep,
done: finishJSTest
done: testDone
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment