- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / test / data / extensions / platform_apps / web_view / nopermission / embedder.js
1 // Copyright 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 // This test verifies that the <webview> API is undefined if the webview
6 // permission is not specified in the manifest file.
7 function testAPIMethodExistence() {
8   var apiMethodsToCheck = [
9     'back',
10     'canGoBack',
11     'canGoForward',
12     'forward',
13     'getProcessId',
14     'go',
15     'reload',
16     'stop',
17     'terminate'
18   ];
19   var webview = document.createElement('webview');
20   for (var i = 0; i < apiMethodsToCheck.length; ++i) {
21     chrome.test.assertEq('undefined',
22                          typeof webview[apiMethodsToCheck[i]]);
23   }
24
25   // Check contentWindow.
26   chrome.test.assertEq('undefined', typeof webview.contentWindow);
27   chrome.test.succeed();
28 }
29
30 chrome.test.runTests([
31   testAPIMethodExistence
32 ]);