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

Unified Diff: chrome/test/data/extensions/api_test/bluetooth_low_energy/start_stop_notifications/runtest.js

Issue 593163002: Short-circuit failures in BLE js tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Testing new cls Created 6 years, 3 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: chrome/test/data/extensions/api_test/bluetooth_low_energy/start_stop_notifications/runtest.js
diff --git a/chrome/test/data/extensions/api_test/bluetooth_low_energy/start_stop_notifications/runtest.js b/chrome/test/data/extensions/api_test/bluetooth_low_energy/start_stop_notifications/runtest.js
index fad86d8054b402209ac6bfbc1577c4a3046473f1..a4c9a7a8753fb7e66b3c0e7b974ebf396701719b 100644
--- a/chrome/test/data/extensions/api_test/bluetooth_low_energy/start_stop_notifications/runtest.js
+++ b/chrome/test/data/extensions/api_test/bluetooth_low_energy/start_stop_notifications/runtest.js
@@ -23,32 +23,22 @@ var ble = chrome.bluetoothLowEnergy;
var start = ble.startCharacteristicNotifications;
var stop = ble.stopCharacteristicNotifications;
-function sendReady(errorMessage) {
- chrome.test.sendMessage('ready', function (message) {
- if (errorMessage) {
- chrome.test.fail(errorMessage);
- return;
- }
-
- chrome.test.runTests([testStartStopNotifications]);
- });
-}
-
function expectError(expectedMessage) {
if (!chrome.runtime.lastError) {
- sendReady('Expected error: ' + expectedMessage);
+ chrome.test.sendMessage('Expected error: ' + expectedMessage);
return;
}
if (chrome.runtime.lastError.message != expectedMessage) {
- sendReady('Expected error: ' + expectedMessage + ', got error: ' +
- expectedMessage);
+ chrome.test.sendMessage('Expected error: ' + expectedMessage
+ + ', got error: ' + expectedMessage);
}
}
function expectSuccess() {
if (chrome.runtime.lastError) {
- sendReady('Unexpected error: ' + chrome.runtime.lastError.message);
+ chrome.test.sendMessage('Unexpected error: '
+ + chrome.runtime.lastError.message);
}
}
@@ -76,7 +66,9 @@ start('foo', function () {
expectError(errorNotNotifying);
stop(charId2, function () {
expectError(errorNotNotifying);
- sendReady(undefined);
+ chrome.test.sendMessage('ready', function (message) {
+ chrome.test.runTests([testStartStopNotifications]);
+ });
});
});
});

Powered by Google App Engine
This is Rietveld 408576698