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

Side by Side Diff: chrome/test/data/extensions/get_app_details_for_frame.html

Issue 10174001: Add an API for hosted apps to check their install and running states. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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
1 <script> 1 <script>
2 function testUnsuccessfulAccess() { 2 function testUnsuccessfulAccess() {
3 try { 3 try {
4 chrome.app.getDetailsForFrame(frames[0]); 4 chrome.app.getDetailsForFrame(frames[0]);
5 } catch (e) { 5 } catch (e) {
6 if (e.indexOf("Access denied") == 0) 6 if (e.indexOf("Access denied") == 0)
7 return true; 7 return true;
8 else 8 else
9 throw e; 9 throw e;
10 } 10 }
11 return false; 11 return false;
12 } 12 }
13 13
14 function getFrameURL(host) { 14 function getFrameURL(host) {
15 var result = "http://" + host; 15 var result = "http://" + host;
16 if (location.port) { 16 if (location.port) {
17 result += ":"; 17 result += ":";
18 result += location.port; 18 result += location.port;
19 } 19 }
20 result += location.pathname; 20 result += location.pathname;
21 return result; 21 return result;
22 } 22 }
23 23
24 var iframe = document.createElement("iframe"); 24 function newFrame(host) {
25 iframe.src = getFrameURL("app.com"); 25 if (frames.length > 0)
26 document.documentElement.appendChild(iframe); 26 document.documentElement.removeChild(document.querySelector('iframe'));
27 var iframe = document.createElement("iframe");
28 iframe.src = getFrameURL(host);
29 document.documentElement.appendChild(iframe);
30 }
31
32 newFrame('app.com');
33
27 </script> 34 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698