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

Unified Diff: chrome/test/data/extensions/lock_screen_apps/app_launch/test.js

Issue 2927303003: Add hooks to allow lock screen app pages in sign-in profile (Closed)
Patch Set: . Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
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();
+ },
+]);

Powered by Google App Engine
This is Rietveld 408576698