| OLD | NEW |
| 1 <!-- |
| 2 * Copyright (c) 2011 The Chromium Authors. All rights reserved. Use of this |
| 3 * source code is governed by a BSD-style license that can be found in the |
| 4 * LICENSE file. |
| 5 --> |
| 1 <script src="tabs_util.js"></script> | 6 <script src="tabs_util.js"></script> |
| 2 | 7 <script src="relative_urls.js"></script> |
| 3 <script> | |
| 4 var firstWindowId; | |
| 5 var relativePageLoaded; | |
| 6 | |
| 7 chrome.test.runTests([ | |
| 8 function setupRelativeUrlTests() { | |
| 9 createWindow(["about:blank"], {}, pass(function(winId, tabIds) { | |
| 10 firstWindowId = winId; | |
| 11 })); | |
| 12 }, | |
| 13 | |
| 14 function relativeUrlTestsTabsCreate() { | |
| 15 // Will be called from relative.html | |
| 16 relativePageLoaded = chrome.test.callbackAdded(); | |
| 17 var createCompleted = chrome.test.callbackAdded(); | |
| 18 | |
| 19 chrome.tabs.create({windowId: firstWindowId, url: 'relative.html'}, | |
| 20 function(tab){ | |
| 21 testTabId = tab.id; | |
| 22 createCompleted(); | |
| 23 } | |
| 24 ); | |
| 25 }, | |
| 26 | |
| 27 function relativeUrlTestsTabsUpdate() { | |
| 28 // Will be called from relative.html | |
| 29 relativePageLoaded = chrome.test.callbackAdded(); | |
| 30 | |
| 31 chrome.tabs.update(testTabId, {url: pageUrl("a")}, function(tab) { | |
| 32 chrome.test.assertEq(pageUrl("a"), tab.url); | |
| 33 chrome.tabs.update(tab.id, {url: "relative.html"}, function(tab) { | |
| 34 }); | |
| 35 }); | |
| 36 }, | |
| 37 | |
| 38 function relativeUrlTestsWindowCreate() { | |
| 39 // Will be called from relative.html | |
| 40 relativePageLoaded = chrome.test.callbackAdded(); | |
| 41 | |
| 42 chrome.windows.create({url: "relative.html"}); | |
| 43 } | |
| 44 | |
| 45 ]); | |
| 46 </script> | |
| OLD | NEW |