| 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); | 7 domAutomationController.send(msg); |
| 8 // The automation controller seems to choke on Objects, so turn them into | |
| 9 // strings. | |
| 10 domAutomationController.send(JSON.stringify(msg)); | |
| 11 }, | 8 }, |
| 12 | 9 |
| 13 log: function(message) { | 10 log: function(message) { |
| 14 load_util.report({type: "Log", message: message}); | 11 load_util.report({type: "Log", message: message}); |
| 15 }, | 12 }, |
| 16 | 13 |
| 17 shutdown: function(message, passed) { | 14 shutdown: function(message, passed) { |
| 18 load_util.report({type: "Shutdown", message: message, passed: passed}); | 15 load_util.report({type: "Shutdown", message: message, passed: passed}); |
| 19 }, | 16 }, |
| 20 | 17 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 embed.addEventListener("error", function(event) { | 58 embed.addEventListener("error", function(event) { |
| 62 if (embed.lastError != "NaCl module load failed: " + message) { | 59 if (embed.lastError != "NaCl module load failed: " + message) { |
| 63 load_util.log("Unexpected load error: " + embed.lastError); | 60 load_util.log("Unexpected load error: " + embed.lastError); |
| 64 load_util.shutdown("1 test failed.", false); | 61 load_util.shutdown("1 test failed.", false); |
| 65 } else { | 62 } else { |
| 66 load_util.shutdown("1 test passed.", true); | 63 load_util.shutdown("1 test passed.", true); |
| 67 } | 64 } |
| 68 }, true); | 65 }, true); |
| 69 } | 66 } |
| 70 }; | 67 }; |
| OLD | NEW |