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

Unified Diff: native_client_sdk/src/tests/nacl_io_socket_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: . 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/nacl_io_socket_test/example.js
diff --git a/native_client_sdk/src/tests/nacl_io_socket_test/example.js b/native_client_sdk/src/tests/nacl_io_socket_test/example.js
index 72b21ce94e106996e7f92cb6202e2ab90cf6c565..8b95dbf6a1e345831204e5b16efda2923c103603 100644
--- a/native_client_sdk/src/tests/nacl_io_socket_test/example.js
+++ b/native_client_sdk/src/tests/nacl_io_socket_test/example.js
@@ -2,7 +2,6 @@
// 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.
-
function moduleDidLoad() {
// The module is not hidden by default so we can easily see if the plugin
// failed to load.
@@ -10,6 +9,8 @@ function moduleDidLoad() {
}
var currentTestEl = null;
+var failedTests = 0;
+var testsFinished = false;
function startCommand(testName) {
var testListEl = document.getElementById('tests');
@@ -33,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) {
@@ -42,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