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

Unified Diff: chrome/browser/chromeos/extensions/info_private_apitest.cc

Issue 2686233006: Add managed device signal (Closed)
Patch Set: Minor comments change Created 3 years, 10 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/browser/chromeos/extensions/info_private_apitest.cc
diff --git a/chrome/browser/chromeos/extensions/info_private_apitest.cc b/chrome/browser/chromeos/extensions/info_private_apitest.cc
index 10fc35292e64a714a8cdc564711486455c66f6f6..f087e931d8780dd9bf878561c743fff78f515d77 100644
--- a/chrome/browser/chromeos/extensions/info_private_apitest.cc
+++ b/chrome/browser/chromeos/extensions/info_private_apitest.cc
@@ -3,8 +3,11 @@
// found in the LICENSE file.
#include "base/values.h"
+#include "chrome/browser/browser_process.h"
tbarzic 2017/02/22 02:18:35 nit: this is not needed, is it?
Wenzhao (Colin) Zang 2017/02/22 03:11:06 Done.
#include "chrome/browser/chromeos/arc/arc_util.h"
+#include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
#include "chrome/browser/chromeos/settings/cros_settings.h"
+#include "chrome/browser/chromeos/settings/stub_install_attributes.h"
#include "chrome/browser/extensions/extension_apitest.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
@@ -112,3 +115,28 @@ IN_PROC_BROWSER_TEST_F(ChromeOSArcInfoPrivateTest, ArcAvailable) {
"arc available"))
<< message_;
}
+
+class ChromeOSManagedDeviceInfoPrivateTest : public ChromeOSInfoPrivateTest {
+ public:
+ ChromeOSManagedDeviceInfoPrivateTest() = default;
+ ~ChromeOSManagedDeviceInfoPrivateTest() override = default;
+
+ protected:
+ void SetUpInProcessBrowserTestFixture() override {
+ // Set up fake install attributes.
+ std::unique_ptr<chromeos::StubInstallAttributes> attributes =
+ base::MakeUnique<chromeos::StubInstallAttributes>();
+ attributes->SetEnterprise("fake-domain", "fake-id");
+ policy::BrowserPolicyConnectorChromeOS::SetInstallAttributesForTesting(
+ attributes.release());
+ ChromeOSInfoPrivateTest::SetUpInProcessBrowserTestFixture();
+ }
tbarzic 2017/02/22 02:18:35 nit: add DISALLOW_COPY_AND_ASSIGN
Wenzhao (Colin) Zang 2017/02/22 03:11:07 Done.
+};
+
+IN_PROC_BROWSER_TEST_F(ChromeOSManagedDeviceInfoPrivateTest, Managed) {
Rahul Chaturvedi 2017/02/22 00:00:13 Nit: You want to test all the code paths here. Thi
Wenzhao (Colin) Zang 2017/02/22 00:39:04 The unmanaged value is default and the code path h
+ // The default status is not managed, which is tested by
+ // ChromeOSInfoPrivateTest.
+ ASSERT_TRUE(
+ RunPlatformAppTestWithArg("chromeos_info_private/extended", "managed"))
+ << message_;
+}

Powered by Google App Engine
This is Rietveld 408576698