Unregister from GCM when the only GCM app is removed
[chromium-blink-merge.git] / chrome / test / data / nacl / nonsfi / libc_free.html
blobe6ad59d5e6baf66f8622075c37fa7e3de3445499
1 <html>
2 <!--
3 Copyright 2014 The Chromium Authors. All rights reserved.
4 Use of this source code is governed by a BSD-style license that can be
5 found in the LICENSE file.
6 -->
7 <!-- This file has tests to make sure Non-SFI NaCl loads and starts
8 up. libc_free.c is shared with irt_test.html where more IRT tests are
9 done. -->
10 <head>
11 <title>NaCl Load Test</title>
12 </head>
13 <body>
14 <h2>NaCl Load Test</h2>
15 </body>
16 <script type="text/javascript" src="nacltest.js"> </script>
17 <script>
19 function report(msg) {
20 domAutomationController.setAutomationId(0);
21 // The automation controller seems to choke on Objects, so turn them into
22 // strings.
23 domAutomationController.send(JSON.stringify(msg));
26 function create(manifest_url) {
27 var embed = document.createElement("embed");
28 embed.src = manifest_url;
29 embed.type = "application/x-nacl";
31 embed.addEventListener("error", function(evt) {
32 report({type: "Log", message: "Load error: " + embed.lastError});
33 report({type: "Shutdown", message: "1 test failed.", passed: false});
34 }, true);
36 embed.addEventListener("load", function(evt) {
37 report({type: "Log", message: "Load is completed."});
38 // The loading is successfully done, so send a message to plugin.
39 // The message should be relayed back to the Javascript code.
40 embed.postMessage("Message from Javascript to NaCl");
41 }, true);
43 embed.addEventListener("message", function(message) {
44 if (message.data != "Message from Javascript to NaCl") {
45 report({type: "Log", message: "Post Message error: " + message.data});
46 report({type: "Shutdown", message: "1 test failed.", passed: false});
47 return;
50 // Message is sent back. So, the test passes.
51 report({type: "Shutdown", message: "1 test passed.", passed: true});
52 }, true);
54 document.body.appendChild(embed);
57 create("libc_free.nmf");
58 </script>
59 </html>