Index: chrome/test/data/extensions/lock_screen_apps/app_launch/background.js |
diff --git a/chrome/test/data/extensions/lock_screen_apps/app_launch/background.js b/chrome/test/data/extensions/lock_screen_apps/app_launch/background.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..df6090f33842a6833a85c9f80ff0a8f3f15e77c2 |
--- /dev/null |
+++ b/chrome/test/data/extensions/lock_screen_apps/app_launch/background.js |
@@ -0,0 +1,32 @@ |
+// 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.app.runtime.onLaunched.addListener(function(data) { |
+ chrome.test.runTests([ |
+ function launchTest() { |
+ chrome.test.assertTrue(!!data); |
+ chrome.test.assertTrue(!!data.actionData); |
+ chrome.test.assertEq('new_note', data.actionData.actionType); |
+ chrome.test.assertTrue(data.actionData.isLockScreenAction); |
+ |
+ chrome.app.window.create('test.html', { |
+ lockScreenAction: 'new_note' |
+ }, chrome.test.callbackPass(function(createdWindow) { |
+ chrome.test.listenOnce(createdWindow.onClosed, |
+ chrome.test.callbackPass(function() {})); |
+ })); |
+ }, |
+ |
+ function cannotCreateWindowWithoutActionLaunch() { |
+ chrome.app.window.create('test.html', { |
+ lockScreenAction: 'new_note' |
+ }, chrome.test.callbackFail('Failed to create the app window.')); |
+ }, |
+ |
+ function noIdentityAccess() { |
+ chrome.test.assertTrue(!chrome.identity); |
+ chrome.test.succeed(); |
+ }, |
+ ]); |
+}); |