OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 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 chrome.test.runTests([ |
| 6 function noAccessToIdentity() { |
| 7 chrome.test.assertTrue(!chrome.identity); |
| 8 chrome.test.succeed(); |
| 9 }, |
| 10 |
| 11 function hasAccessToCurrentWindow() { |
| 12 chrome.test.assertTrue(!!chrome.app.window.current); |
| 13 chrome.test.assertTrue(!!chrome.app.window.current()); |
| 14 chrome.test.assertTrue(chrome.app.window.current().isMaximized()); |
| 15 chrome.test.succeed(); |
| 16 }, |
| 17 |
| 18 function cannotCreateSecondWindow() { |
| 19 chrome.app.window.create('test.html', { |
| 20 lockScreenAction: 'new_note' |
| 21 }, chrome.test.callbackFail('Failed to create the app window.')); |
| 22 }, |
| 23 |
| 24 function reportReadyToClose() { |
| 25 // Notify the test runner the app window is ready to be closed - if the test |
| 26 // runner replies with 'close', close the current app window. Otherwise, the |
| 27 // test runner will close the window itself. |
| 28 // NOTE: Reporting the test success should not wait for this - the test |
| 29 // runner should be notified of test run success before responding to |
| 30 // this message to avoid test done message being disregarded due to app |
| 31 // window clusure. |
| 32 chrome.test.sendMessage('readyToClose', function(response) { |
| 33 if (response === 'close') |
| 34 chrome.app.window.current().close(); |
| 35 }); |
| 36 |
| 37 chrome.test.succeed(); |
| 38 }, |
| 39 ]); |
OLD | NEW |