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

Unified Diff: chrome/browser/chromeos/policy/login_policy_test_base.h

Issue 964503002: Implemented ForceMaximizeBrowserWindowOnFirstRun policy, added unit test and browser test. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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/policy/login_policy_test_base.h
diff --git a/chrome/browser/chromeos/policy/login_policy_test_base.h b/chrome/browser/chromeos/policy/login_policy_test_base.h
new file mode 100644
index 0000000000000000000000000000000000000000..cf4f8480dcc7c173ea7a57bd57af19ff618ea427
--- /dev/null
+++ b/chrome/browser/chromeos/policy/login_policy_test_base.h
@@ -0,0 +1,59 @@
+// Copyright 2015 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.
+
+#ifndef CHROME_BROWSER_CHROMEOS_POLICY_LOGIN_POLICY_TEST_BASE_H_
+#define CHROME_BROWSER_CHROMEOS_POLICY_LOGIN_POLICY_TEST_BASE_H_
+
+#include <string>
+
+#include "base/files/scoped_temp_dir.h"
+#include "base/macros.h"
+#include "base/memory/scoped_ptr.h"
+#include "chrome/browser/chromeos/login/test/oobe_base_test.h"
+
+namespace base {
+class FilePath;
+class DictionaryValue;
+}
+
+namespace policy {
+
+class LocalPolicyTestServer;
+
+// This class can be used to implement tests which need policy to be set prior
+// to login.
+class LoginPolicyTestBase : public chromeos::OobeBaseTest {
+ protected:
+ LoginPolicyTestBase();
+ ~LoginPolicyTestBase() override;
+
+ // chromeos::OobeBaseTest::
+ void SetUp() override;
+ void SetUpCommandLine(base::CommandLine* command_line) override;
+ void SetUpOnMainThread() override;
+
+ virtual scoped_ptr<base::DictionaryValue> GetMandatoryPoliciesValue() const;
+ virtual scoped_ptr<base::DictionaryValue> GetRecommendedPoliciesValue() const;
+
+ void SkipToLoginScreen();
+ void LogIn(const std::string& user_id, const std::string& password);
+
+ static const char kAccountPassword[];
+ static const char kAccountId[];
+
+ private:
+ void SetUpGaiaServerWithAccessTokens();
+ void SetMergeSessionParams(const std::string& email);
+ void SetServerPolicy();
+ base::FilePath PolicyFilePath() const;
+
+ scoped_ptr<LocalPolicyTestServer> test_server_;
+ base::ScopedTempDir temp_dir_;
+
+ DISALLOW_COPY_AND_ASSIGN(LoginPolicyTestBase);
+};
+
+} // namespace policy
+
+#endif // CHROME_BROWSER_CHROMEOS_POLICY_LOGIN_POLICY_TEST_BASE_H_

Powered by Google App Engine
This is Rietveld 408576698