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

Unified Diff: chrome/browser/chromeos/settings/shutdown_policy_handler_unittest.cc

Issue 811033002: Add device policy to disallow shutdown - ash UI modifications (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: reduced scope of CL (ash only now, removed webui changes) Created 5 years, 11 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/settings/shutdown_policy_handler_unittest.cc
diff --git a/chrome/browser/ui/webui/chromeos/login/shutdown_policy_observer_unittest.cc b/chrome/browser/chromeos/settings/shutdown_policy_handler_unittest.cc
similarity index 83%
rename from chrome/browser/ui/webui/chromeos/login/shutdown_policy_observer_unittest.cc
rename to chrome/browser/chromeos/settings/shutdown_policy_handler_unittest.cc
index 4136f994f68276b88b44640de398e3b37412f45a..8550469133e94cf07147e72dd4df276e612b6995 100644
--- a/chrome/browser/ui/webui/chromeos/login/shutdown_policy_observer_unittest.cc
+++ b/chrome/browser/chromeos/settings/shutdown_policy_handler_unittest.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/ui/webui/chromeos/login/shutdown_policy_observer.h"
+#include "chrome/browser/chromeos/settings/shutdown_policy_handler.h"
#include "base/bind.h"
#include "base/bind_helpers.h"
@@ -20,8 +20,8 @@
namespace chromeos {
-class ShutdownPolicyObserverTest : public testing::Test,
- public ShutdownPolicyObserver::Delegate {
+class ShutdownPolicyHandlerTest : public testing::Test,
+ public ShutdownPolicyHandler::Delegate {
Daniel Erat 2015/01/07 16:18:40 nit: fix indenting
cschuet (SLOW) 2015/01/13 10:38:28 Done.
public:
void ResultCallback(bool reboot_on_shutdown) {
reboot_on_shutdown_ = reboot_on_shutdown;
@@ -29,7 +29,7 @@ class ShutdownPolicyObserverTest : public testing::Test,
}
protected:
- ShutdownPolicyObserverTest()
+ ShutdownPolicyHandlerTest()
: cros_settings_(nullptr),
callback_called_(false),
reboot_on_shutdown_(false),
@@ -58,7 +58,7 @@ class ShutdownPolicyObserverTest : public testing::Test,
base::RunLoop().RunUntilIdle();
}
- // ShutdownPolicyObserver::Delegate:
+ // ShutdownPolicyHandler::Delegate:
void OnShutdownPolicyChanged(bool reboot_on_shutdown) override {
reboot_on_shutdown_ = reboot_on_shutdown;
delegate_invocations_count_++;
@@ -78,8 +78,8 @@ class ShutdownPolicyObserverTest : public testing::Test,
int delegate_invocations_count_;
};
-TEST_F(ShutdownPolicyObserverTest, RetrieveTrustedDevicePolicies) {
- ShutdownPolicyObserver shutdown_policy_observer(cros_settings_, this);
+TEST_F(ShutdownPolicyHandlerTest, RetrieveTrustedDevicePolicies) {
+ ShutdownPolicyHandler shutdown_policy_observer(cros_settings_, this);
base::RunLoop().RunUntilIdle();
EXPECT_EQ(0, delegate_invocations_count_);
@@ -101,15 +101,15 @@ TEST_F(ShutdownPolicyObserverTest, RetrieveTrustedDevicePolicies) {
EXPECT_FALSE(reboot_on_shutdown_);
}
-TEST_F(ShutdownPolicyObserverTest, CheckIfRebootOnShutdown) {
- ShutdownPolicyObserver shutdown_policy_observer(cros_settings_, this);
+TEST_F(ShutdownPolicyHandlerTest, CheckIfRebootOnShutdown) {
+ ShutdownPolicyHandler shutdown_policy_observer(cros_settings_, this);
base::RunLoop().RunUntilIdle();
// Allow shutdown.
SetRebootOnShutdown(true);
callback_called_ = false;
shutdown_policy_observer.CheckIfRebootOnShutdown(
- base::Bind(&ShutdownPolicyObserverTest::ResultCallback,
+ base::Bind(&ShutdownPolicyHandlerTest::ResultCallback,
base::Unretained(this)));
base::RunLoop().RunUntilIdle();
EXPECT_TRUE(callback_called_);
@@ -118,7 +118,7 @@ TEST_F(ShutdownPolicyObserverTest, CheckIfRebootOnShutdown) {
SetRebootOnShutdown(false);
callback_called_ = false;
shutdown_policy_observer.CheckIfRebootOnShutdown(
- base::Bind(&ShutdownPolicyObserverTest::ResultCallback,
+ base::Bind(&ShutdownPolicyHandlerTest::ResultCallback,
base::Unretained(this)));
base::RunLoop().RunUntilIdle();
EXPECT_TRUE(callback_called_);

Powered by Google App Engine
This is Rietveld 408576698