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.app.runtime.onLaunched.addListener(function(data) { |
| 6 chrome.test.runTests([ |
| 7 function launchTest() { |
| 8 chrome.test.assertTrue(!!data); |
| 9 chrome.test.assertTrue(!!data.actionData); |
| 10 chrome.test.assertEq('new_note', data.actionData.actionType); |
| 11 chrome.test.assertTrue(data.actionData.isLockScreenAction); |
| 12 |
| 13 chrome.app.window.create('test.html', { |
| 14 lockScreenAction: 'new_note' |
| 15 }, chrome.test.callbackPass(function(createdWindow) { |
| 16 chrome.test.listenOnce(createdWindow.onClosed, |
| 17 chrome.test.callbackPass(function() {})); |
| 18 })); |
| 19 }, |
| 20 |
| 21 function cannotCreateWindowWithoutActionLaunch() { |
| 22 chrome.app.window.create('test.html', { |
| 23 lockScreenAction: 'new_note' |
| 24 }, chrome.test.callbackFail('Failed to create the app window.')); |
| 25 }, |
| 26 |
| 27 function noIdentityAccess() { |
| 28 chrome.test.assertTrue(!chrome.identity); |
| 29 chrome.test.succeed(); |
| 30 }, |
| 31 ]); |
| 32 }); |
OLD | NEW |