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

Unified Diff: native_client_sdk/src/tests/sdk_util_test/example.js

Issue 61213002: [NaCl SDK] Run nacl_io_socket_test on the bots. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove removeModule(), it causes a race condition for fast tests Created 7 years, 1 month 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: native_client_sdk/src/tests/sdk_util_test/example.js
diff --git a/native_client_sdk/src/tests/sdk_util_test/example.js b/native_client_sdk/src/tests/sdk_util_test/example.js
index d004ac4510930ae39b240b7bcef1dbe77c266e2d..8b95dbf6a1e345831204e5b16efda2923c103603 100644
--- a/native_client_sdk/src/tests/sdk_util_test/example.js
+++ b/native_client_sdk/src/tests/sdk_util_test/example.js
@@ -1,4 +1,4 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Called by the common.js module.
@@ -9,6 +9,8 @@ function moduleDidLoad() {
}
var currentTestEl = null;
+var failedTests = 0;
+var testsFinished = false;
function startCommand(testName) {
var testListEl = document.getElementById('tests');
@@ -32,6 +34,7 @@ function failCommand(fileName, lineNumber, summary) {
var testMessageEl = document.createElement('pre');
testMessageEl.textContent += fileName + ':' + lineNumber + ': ' + summary;
currentTestEl.appendChild(testMessageEl);
+ failedTests++;
}
function endCommand(testName, testResult) {
@@ -41,10 +44,22 @@ function endCommand(testName, testResult) {
testResultEl.textContent = testResult;
}
+function testendCommand() {
+ testsFinished = true;
+
+ if (failedTests) {
+ common.updateStatus('FAILED');
+ document.getElementById('statusField').classList.add('failed');
+ } else {
+ common.updateStatus('OK');
+ document.getElementById('statusField').classList.add('ok');
+ }
+}
+
function handleMessage(event) {
var msg = event.data;
var firstColon = msg.indexOf(':');
- var cmd = msg.substr(0, firstColon);
+ var cmd = firstColon !== -1 ? msg.substr(0, firstColon) : msg;
var cmdFunctionName = cmd + 'Command';
var cmdFunction = window[cmdFunctionName];

Powered by Google App Engine
This is Rietveld 408576698