Add the ability to code generated prepopulated static nested structs
[chromium-blink-merge.git] / ppapi / tests / extensions / packaged_app / controller.js
blobae3c7f074cfdfac1502cdf70018d40d498712516
1 // Copyright 2014 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 var control_message;
7 function testAll() {
8 var nacl_module = document.getElementById('nacl_module');
9 // The plugin will start the corresponding test and post a message back
10 // the test is done. If the test has failed, the message is a description
11 // of the error; otherwise the message is empty.
12 nacl_module.postMessage(control_message);
15 var onControlMessageReceived = function(message) {
16 control_message = message;
17 chrome.test.runTests([testAll]);
20 var pass_count = 0
21 var onPluginMessageReceived = function(message) {
22 if (message.data == "PASS") {
23 pass_count++;
24 if (pass_count == 2)
25 chrome.test.sendMessage("PASS", onControlMessageReceived);
26 } else if (message.data) {
27 chrome.test.fail(message.data);
31 window.onload = function() {
32 var nacl_module = document.getElementById('nacl_module');
33 nacl_module.addEventListener("message", onPluginMessageReceived, false);