- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / test / data / extensions / api_test / permissions / nacl_enabled / background.js
1 // Copyright (c) 2011 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 // OnNaClLoad should be called and invoking a method
6 // in a NaCl module should return a correct value.
7
8 var pass = chrome.test.callbackPass;
9
10 chrome.test.runTests([
11   function nacl() {
12     // Nothing to do here,
13     // we call the callback when we get the notification from NaCl
14   }
15 ]);
16
17 function OnNaClLoad() {
18   try {
19     plugin = document.getElementById('pluginobj');
20     result = plugin.helloworld();
21     if ('hello, world.' != result) {
22       chrome.test.fail();
23     }
24   } catch(e) {
25     chrome.test.fail();
26   }
27   chrome.test.succeed();
28 }
29
30 function OnNaClFail() {
31   chrome.test.fail();
32 }