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

Side by Side Diff: chrome/test/data/extensions/platform_apps/browser_tag/main.js

Issue 11139005: Expose Browser Plugin API in <browser> Tag Shim. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments. Created 8 years, 2 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
« no previous file with comments | « chrome/renderer/resources/extensions/browser_tag.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 onload = function() { 5 onload = function() {
6 chrome.test.runTests([ 6 chrome.test.runTests([
7 function browserTag() { 7 function browserTag() {
8 var browserTag = document.querySelector('browser'); 8 var browserTag = document.querySelector('browser');
9 // Since we can't currently inspect the page loaded inside the <browser>, 9 // Since we can't currently inspect the page loaded inside the <browser>,
10 // the only way we can check that the shim is working is by changing the 10 // the only way we can check that the shim is working is by changing the
(...skipping 30 matching lines...) Expand all
41 document.body.appendChild(dynamicBrowserTag); 41 document.body.appendChild(dynamicBrowserTag);
42 42
43 setTimeout(function() { 43 setTimeout(function() {
44 chrome.test.assertEq(330, dynamicBrowserTag.offsetWidth); 44 chrome.test.assertEq(330, dynamicBrowserTag.offsetWidth);
45 chrome.test.assertEq(230, dynamicBrowserTag.offsetHeight); 45 chrome.test.assertEq(230, dynamicBrowserTag.offsetHeight);
46 46
47 chrome.test.succeed(); 47 chrome.test.succeed();
48 }, 0); 48 }, 0);
49 }, 0); 49 }, 0);
50 }, 0); 50 }, 0);
51 },
52
53 function browserTagApiMethodExistence() {
54 var browserTag = document.createElement('browser');
55 browserTag.setAttribute('src', 'data:text/html,browser tag check api');
56 var apiMethodsToCheck = [
57 'addEventListener',
58 'back',
59 'forward',
60 'getProcessId',
61 'go',
62 'reload',
63 'removeEventListener',
64 'stop',
65 'terminate'
66 ];
67 document.body.appendChild(browserTag);
68
69 // Timeout is necessary to give the mutation observers a chance to fire.
70 setTimeout(function() {
71 for (var i = 0; i < apiMethodsToCheck.length; ++i) {
72 chrome.test.assertEq('function',
73 typeof browserTag[apiMethodsToCheck[i]]);
74 }
75 chrome.test.succeed();
76 }, 0);
51 } 77 }
52 ]); 78 ]);
53 }; 79 };
OLDNEW
« no previous file with comments | « chrome/renderer/resources/extensions/browser_tag.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698