Chromium Code Reviews| Index: chrome/browser/chromeos/policy/device_policy_cros_browser_test.h |
| diff --git a/chrome/browser/chromeos/policy/device_policy_cros_browser_test.h b/chrome/browser/chromeos/policy/device_policy_cros_browser_test.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..2771f48dd8c4bd040eab885baa2f8118ca45fae7 |
| --- /dev/null |
| +++ b/chrome/browser/chromeos/policy/device_policy_cros_browser_test.h |
| @@ -0,0 +1,69 @@ |
| +// Copyright (c) 2013 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_DEVICE_POLICY_CROS_BROWSER_TEST_H_ |
| +#define CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_POLICY_CROS_BROWSER_TEST_H_ |
| + |
| +#include "base/files/scoped_temp_dir.h" |
| +#include "chrome/browser/chromeos/cros/cros_in_process_browser_test.h" |
| +#include "chrome/browser/chromeos/policy/device_policy_builder.h" |
| +#include "chrome/browser/chromeos/policy/proto/chrome_device_policy.pb.h" |
|
Mattias Nissler (ping if slow)
2013/04/22 10:07:43
not needed?
Mathieu
2013/04/22 14:14:23
Done.
|
| +#include "chrome/browser/metrics/variations/variations_service.h" |
|
Mattias Nissler (ping if slow)
2013/04/22 10:07:43
not needed
Mathieu
2013/04/22 14:14:23
Done.
|
| +#include "chrome/common/chrome_paths.h" |
|
Mattias Nissler (ping if slow)
2013/04/22 10:07:43
not needed?
Mathieu
2013/04/22 14:14:23
Done.
|
| +#include "chrome/test/base/testing_browser_process.h" |
|
Mattias Nissler (ping if slow)
2013/04/22 10:07:43
not needed / forward-declare?
Mathieu
2013/04/22 14:14:23
Done.
|
| +#include "chromeos/dbus/fake_session_manager_client.h" |
| +#include "chromeos/dbus/mock_dbus_thread_manager.h" |
|
Mattias Nissler (ping if slow)
2013/04/22 10:07:43
forward-declare?
Mathieu
2013/04/22 14:14:23
Done.
|
| +#include "testing/gtest/include/gtest/gtest.h" |
| + |
| +namespace policy { |
| + |
| +// Used to test Device policy changes in Chrome OS. |
| +class DevicePolicyCrosBrowserTest : |
| + public chromeos::CrosInProcessBrowserTest { |
| + protected: |
| + DevicePolicyCrosBrowserTest(); |
| + virtual ~DevicePolicyCrosBrowserTest(); |
| + |
| + virtual void SetUpInProcessBrowserTestFixture() OVERRIDE; |
|
Mattias Nissler (ping if slow)
2013/04/22 10:07:43
#include "base/compiler_specific.h"
Mathieu
2013/04/22 14:14:23
Done.
|
| + |
| + void InstallOwnerKey(); |
|
Mattias Nissler (ping if slow)
2013/04/22 10:07:43
Needs docs: What it does and when to call.
Mathieu
2013/04/22 14:14:23
Done.
|
| + |
| + void RefreshDevicePolicy(); |
|
Mattias Nissler (ping if slow)
2013/04/22 10:07:43
ditto
Mathieu
2013/04/22 14:14:23
Done.
|
| + |
| + virtual void TearDownInProcessBrowserTestFixture() OVERRIDE; |
| + |
| + BrowserProcess* browser_process() { return g_browser_process; } |
| + |
| + chromeos::MockDBusThreadManager* mock_dbus_thread_manager() { |
| + return mock_dbus_thread_manager_; |
| + } |
| + |
| + chromeos::FakeSessionManagerClient* session_manager_client() { |
| + return &session_manager_client_; |
| + } |
| + |
| + DevicePolicyBuilder* device_policy() { return &device_policy_; } |
| + |
| + private: |
| + // Set additional expectations on |mock_dbus_thread_manager_| to suppress |
| + // gmock warnings. |
| + void SetMockDBusThreadManagerExpectations(); |
| + |
| + chromeos::MockDBusThreadManager* mock_dbus_thread_manager_; |
| + |
| + // Mock out policy loads/stores from/to the device. |
| + chromeos::FakeSessionManagerClient session_manager_client_; |
| + |
| + // Carries Chrome OS device policies for tests. |
| + DevicePolicyBuilder device_policy_; |
| + |
| + // Stores the device owner key. |
| + base::ScopedTempDir temp_dir_; |
|
Mattias Nissler (ping if slow)
2013/04/22 10:07:43
#include "base/files/scoped_temp_dir.h"
Mathieu
2013/04/22 14:14:23
Done.
|
| + |
| + DISALLOW_COPY_AND_ASSIGN(DevicePolicyCrosBrowserTest); |
|
Mattias Nissler (ping if slow)
2013/04/22 10:07:43
#include "base/basictypes.h"
Mathieu
2013/04/22 14:14:23
Done.
|
| +}; |
| + |
| +} // namespace policy |
| + |
| +#endif // CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_POLICY_CROS_BROWSER_TEST_H_ |