OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 var load_util = { | 5 var load_util = { |
6 report: function(msg) { | 6 report: function(msg) { |
7 domAutomationController.setAutomationId(0); | |
8 // The automation controller seems to choke on Objects, so turn them into | 7 // The automation controller seems to choke on Objects, so turn them into |
9 // strings. | 8 // strings. |
10 domAutomationController.send(JSON.stringify(msg)); | 9 domAutomationController.send(JSON.stringify(msg)); |
11 }, | 10 }, |
12 | 11 |
13 log: function(message) { | 12 log: function(message) { |
14 load_util.report({type: "Log", message: message}); | 13 load_util.report({type: "Log", message: message}); |
15 }, | 14 }, |
16 | 15 |
17 shutdown: function(message, passed) { | 16 shutdown: function(message, passed) { |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 embed.addEventListener("error", function(event) { | 60 embed.addEventListener("error", function(event) { |
62 if (embed.lastError != "NaCl module load failed: " + message) { | 61 if (embed.lastError != "NaCl module load failed: " + message) { |
63 load_util.log("Unexpected load error: " + embed.lastError); | 62 load_util.log("Unexpected load error: " + embed.lastError); |
64 load_util.shutdown("1 test failed.", false); | 63 load_util.shutdown("1 test failed.", false); |
65 } else { | 64 } else { |
66 load_util.shutdown("1 test passed.", true); | 65 load_util.shutdown("1 test passed.", true); |
67 } | 66 } |
68 }, true); | 67 }, true); |
69 } | 68 } |
70 }; | 69 }; |
OLD | NEW |