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

Unified Diff: chrome/test/data/extensions/api_test/chromeos_info_private/extended/background.js

Issue 2314313002: Add sessionType and playStoreStatus to chromeosInfoPrivate. (Closed)
Patch Set: review comments Created 4 years, 3 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/api_test/chromeos_info_private/extended/background.js
diff --git a/chrome/test/data/extensions/api_test/chromeos_info_private/extended/background.js b/chrome/test/data/extensions/api_test/chromeos_info_private/extended/background.js
new file mode 100644
index 0000000000000000000000000000000000000000..358d828d0c9ecdf8215e41c99cebe8888560cb7a
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/chromeos_info_private/extended/background.js
@@ -0,0 +1,28 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
Devlin 2016/09/07 16:12:28 not 2011 :)
Rahul Chaturvedi 2016/09/07 20:13:24 Done.
+// 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() {
+ chrome.test.getConfig(function(config) {
+ var testArgs = JSON.parse(config.customArg);
Devlin 2016/09/07 16:12:28 Why not just pass the test name?
Rahul Chaturvedi 2016/09/07 20:13:23 Done.
+ if (!testArgs) {
+ chrome.test.fail("Missing test args.");
+ return;
+ }
+ if (!testArgs.testName) {
+ chrome.test.fail("Missing test name.");
+ return;
+ }
+ chrome.chromeosInfoPrivate.get(['sessionType', 'playStoreStatus'],
+ function (values) {
+ if (testArgs.testName == 'kiosk') {
+ chrome.test.assertEq('kiosk', values['sessionType']);
+ } else if (testArgs.testName == 'arc available') {
+ chrome.test.assertEq('available', values['playStoreStatus']);
+ } else if (testArgs.testName == 'arc enabled') {
+ chrome.test.assertEq('enabled', values['playStoreStatus']);
+ }
+ chrome.test.succeed();
+ });
+ });
+});

Powered by Google App Engine
This is Rietveld 408576698