| Index: chrome/test/data/extensions/lock_screen_apps/app_launch/test.js
|
| diff --git a/chrome/test/data/extensions/lock_screen_apps/app_launch/test.js b/chrome/test/data/extensions/lock_screen_apps/app_launch/test.js
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..ddec9769f5c7694ca664872adcb57cb4eab0d3f3
|
| --- /dev/null
|
| +++ b/chrome/test/data/extensions/lock_screen_apps/app_launch/test.js
|
| @@ -0,0 +1,39 @@
|
| +// Copyright 2017 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +chrome.test.runTests([
|
| + function noAccessToIdentity() {
|
| + chrome.test.assertTrue(!chrome.identity);
|
| + chrome.test.succeed();
|
| + },
|
| +
|
| + function hasAccessToCurrentWindow() {
|
| + chrome.test.assertTrue(!!chrome.app.window.current);
|
| + chrome.test.assertTrue(!!chrome.app.window.current());
|
| + chrome.test.assertTrue(chrome.app.window.current().isMaximized());
|
| + chrome.test.succeed();
|
| + },
|
| +
|
| + function cannotCreateSecondWindow() {
|
| + chrome.app.window.create('test.html', {
|
| + lockScreenAction: 'new_note'
|
| + }, chrome.test.callbackFail('Failed to create the app window.'));
|
| + },
|
| +
|
| + function reportReadyToClose() {
|
| + // Notify the test runner the app window is ready to be closed - if the test
|
| + // runner replies with 'close', close the current app window. Otherwise, the
|
| + // test runner will close the window itself.
|
| + // NOTE: Reporting the test success should not wait for this - the test
|
| + // runner should be notified of test run success before responding to
|
| + // this message to avoid test done message being disregarded due to app
|
| + // window clusure.
|
| + chrome.test.sendMessage('readyToClose', function(response) {
|
| + if (response === 'close')
|
| + chrome.app.window.current().close();
|
| + });
|
| +
|
| + chrome.test.succeed();
|
| + },
|
| +]);
|
|
|