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

Unified Diff: chrome/browser/ui/ash/screenshot_taker_unittest.cc

Issue 22715006: Suppressing screenshot messages as long as the login screen is shown and no user is logged in. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed Created 7 years, 4 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
« no previous file with comments | « chrome/browser/ui/ash/screenshot_taker.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/ash/screenshot_taker_unittest.cc
diff --git a/chrome/browser/ui/ash/screenshot_taker_unittest.cc b/chrome/browser/ui/ash/screenshot_taker_unittest.cc
index a35339af4ccfcc8faca9782b3691c5233a461288..f27b97a88748bb81f77e2096ff04fdacbeb11699 100644
--- a/chrome/browser/ui/ash/screenshot_taker_unittest.cc
+++ b/chrome/browser/ui/ash/screenshot_taker_unittest.cc
@@ -22,6 +22,10 @@
#include "ui/aura/root_window.h"
#include "ui/message_center/message_center_switches.h"
+#if defined(OS_CHROMEOS)
+#include "chromeos/login/login_state.h"
+#endif
+
namespace ash {
namespace test {
@@ -94,6 +98,12 @@ class ScreenshotTakerTest : public AshTestBase,
};
TEST_F(ScreenshotTakerTest, TakeScreenshot) {
+#if defined(OS_CHROMEOS)
+ // Note that within the test framework the LoginState object will always
+ // claim that the user did log in.
+ ASSERT_FALSE(chromeos::LoginState::IsInitialized());
+ chromeos::LoginState::Initialize();
+#endif
scoped_ptr<TestingProfileManager> profile_manager(
new TestingProfileManager(TestingBrowserProcess::GetGlobal()));
ASSERT_TRUE(profile_manager->SetUp());
@@ -127,6 +137,10 @@ TEST_F(ScreenshotTakerTest, TakeScreenshot) {
if (ScreenshotTakerObserver::SCREENSHOT_SUCCESS == screenshot_result_)
EXPECT_TRUE(base::PathExists(screenshot_path_));
+
+#if defined(OS_CHROMEOS)
+ chromeos::LoginState::Shutdown();
+#endif
}
} // namespace test
« no previous file with comments | « chrome/browser/ui/ash/screenshot_taker.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698