Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / chrome / test / data / nacl / simple_cc.js
blob52c4ea3eb3e516bd6b9881b54ed38047a60cefaf
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // Set up listeners and test expectations for tests which use simple.cc
6 // This depends on load_util.js for reporting.
7 var simple_test = {
8   addTestListeners: function(embed) {
9     embed.addEventListener("load", function(evt) {
10       embed.postMessage("ping");
11     }, true);
13     embed.addEventListener("message", function(message) {
14       var expected_message = "pong";
15       if (message.data === expected_message) {
16         load_util.report({type: "Shutdown",
17                           message: "1 test passed.", passed: true});
18       } else {
19         load_util.report(
20           {type: "Log",
21            message: "Error: expected reply (" + expected_message +
22                     "), actual reply (" + message + ")"});
23         load_util.report({type: "Shutdown",
24                           message: "1 test failed.", passed: false});
25       }
26     }, true);
28     embed.addEventListener("error", function(evt) {
29       load_util.report({type: "Log",
30                         message: "Load error: " + embed.lastError});
31       load_util.report({type: "Shutdown",
32                         message: "1 test failed.", passed: false});
33     }, true);
35     embed.addEventListener("crash", function(evt) {
36       load_util.report({type: "Log",
37                         message: "Crashed with status: " + embed.exitStatus});
38       load_util.report({type: "Shutdown",
39                         message: "1 test failed.", passed: false});
40     }, true);
41   }