Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(154)

Side by Side Diff: chrome/test/data/extensions/api_test/socket/ppapi/controller.js

Issue 13811036: Add Pepper API tests for chrome.socket. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 var control_message;
6
7 function testAll() {
8 var nacl_module = document.getElementById('nacl_module');
9 // The plugin will start the corresponding test and post a message back when
10 // the test is done. If the test has failed, the message is a description of
11 // the error; otherwise the message is empty.
12 nacl_module.postMessage(control_message);
13 }
14
15 var onControlMessageReceived = function(message) {
16 control_message = message;
17 chrome.test.runTests([ testAll ]);
Nick Bray (chromium) 2013/04/12 16:57:45 nit: [ testAll ] => [testAll]
yzshen1 2013/04/12 19:15:05 Done.
18 }
19
20 var onPluginMessageReceived = function(message) {
21 if (message.data == "ready") {
22 chrome.test.sendMessage("info_please", onControlMessageReceived);
23 } else if (message.data) {
24 chrome.test.fail(message.data);
25 } else {
26 chrome.test.succeed();
27 }
28 };
29
30 window.onload = function() {
31 var nacl_module = document.getElementById('nacl_module');
32 nacl_module.addEventListener("message", onPluginMessageReceived, false);
33 };
34
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698