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

Unified Diff: chrome/browser/chromeos/policy/login_policy_base_test.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: Fixed description Created 5 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/policy/login_policy_base_test.h
diff --git a/chrome/browser/chromeos/policy/login_policy_base_test.h b/chrome/browser/chromeos/policy/login_policy_base_test.h
new file mode 100644
index 0000000000000000000000000000000000000000..1405bfc55448d3732cc6d68f62f41f44310c2be8
--- /dev/null
+++ b/chrome/browser/chromeos/policy/login_policy_base_test.h
@@ -0,0 +1,43 @@
+// Copyright 2014 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_BASE_TEST_H_
+#define CHROME_BROWSER_CHROMEOS_POLICY_LOGIN_POLICY_BASE_TEST_H_
+
+#include "base/macros.h"
+#include "base/memory/scoped_ptr.h"
+#include "chrome/browser/chromeos/login/test/oobe_base_test.h"
+#include "chrome/browser/policy/test/local_policy_test_server.h"
bartfab (slow) 2015/03/12 11:54:47 Nit: A forward-declaration is sufficient here. Mov
peletskyi 2015/03/18 13:28:12 Done.
+
+namespace policy {
+
+class LoginPolicyBaseTest : public chromeos::OobeBaseTest {
bartfab (slow) 2015/03/12 11:54:46 Nit 1: This is not a base test, it is a *test base
peletskyi 2015/03/18 13:28:12 Renamed. But why we have OobeBaseTest, not OobeTes
bartfab (slow) 2015/04/01 14:22:41 Yeah, that one is definitely poorly named :(.
+ protected:
+ LoginPolicyBaseTest();
+ ~LoginPolicyBaseTest() override;
bartfab (slow) 2015/03/12 11:54:46 Nit: No need to override the destructor.
peletskyi 2015/03/18 13:28:12 It will not be compiled without override.
bartfab (slow) 2015/04/01 14:22:41 I mean no need to add a destructor at all. You are
peletskyi 2015/04/01 18:55:45 The compiler writes: ../../chrome/browser/chromeos
bartfab (slow) 2015/04/02 08:44:27 Sure, let's leave it. I am still surprise it insis
+
+ void SetUp() override;
bartfab (slow) 2015/03/12 11:54:47 Nit: Add // chromeos::OobeBaseTest:
peletskyi 2015/03/18 13:28:12 Done.
+ void SetUpCommandLine(base::CommandLine* command_line) override;
+ void SetUpOnMainThread() override;
+ void SetupGaiaServerWithAccessTokens();
bartfab (slow) 2015/03/12 11:54:47 Nit 1: Add blank line above. Nit 2: s/Setup/SetUp/
peletskyi 2015/03/18 13:28:12 Done.
+ void SetMergeSessionParams(const std::string& email);
bartfab (slow) 2015/03/12 11:54:47 Nit 1: #include <string> Nit 2: Make this private.
peletskyi 2015/03/18 13:28:12 Done.
+ void SkipToLoginScreen();
+ void LogIn(const std::string& user_id, const std::string& password);
+ void SetServerPolicy();
bartfab (slow) 2015/03/12 11:54:46 Nit: Make this private.
peletskyi 2015/03/18 13:28:12 Done.
+ virtual std::string GetPolicy() const = 0;
+
+ base::FilePath policy_file_path() const;
bartfab (slow) 2015/03/12 11:54:46 1: If a method is not inlined, it should not be na
peletskyi 2015/03/18 13:28:12 (1,2) done. (3) It is used twice :).
+ scoped_ptr<LocalPolicyTestServer> test_server_;
bartfab (slow) 2015/03/12 11:54:47 Nit: Make this private if it is not used by any de
peletskyi 2015/03/18 13:28:12 Done.
+
+ base::ScopedTempDir temp_dir_;
bartfab (slow) 2015/03/12 11:54:47 Nit 1: Make this private if it is not used by any
peletskyi 2015/03/18 13:28:12 Done.
+
+ static const char kAccountPassword[];
bartfab (slow) 2015/03/12 11:54:47 Nit: There is no need for the base class to define
peletskyi 2015/03/18 13:28:12 Yes, but it is needed in both derived classes and
+ static const char kAccountId[];
bartfab (slow) 2015/03/12 11:54:47 I think it would be better to expose this as a met
peletskyi 2015/03/18 13:28:12 What is the advantage? In case with method they wi
bartfab (slow) 2015/04/01 14:22:41 Acknowledged.
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(LoginPolicyBaseTest);
+};
+
+} // namespace policy
+#endif // CHROME_BROWSER_CHROMEOS_POLICY_LOGIN_POLICY_BASE_TEST_H_

Powered by Google App Engine
This is Rietveld 408576698