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

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: Fixed unit test 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
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..2dda1280e460f4f8b5f01403bba67a06bf7f52dd 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 testframework the LoginState object will always claim
James Cook 2013/08/09 20:09:16 testframework -> test framework
Mr4D (OOO till 08-26) 2013/08/09 20:35:45 Done.
+ // 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());
@@ -121,12 +131,17 @@ TEST_F(ScreenshotTakerTest, TakeScreenshot) {
EXPECT_TRUE(g_browser_process->notification_ui_manager()->FindById(
std::string("screenshot")) != NULL);
g_browser_process->notification_ui_manager()->CancelAll();
+
James Cook 2013/08/09 20:09:16 nit: maybe no blank line here?
Mr4D (OOO till 08-26) 2013/08/09 20:35:45 Done.
#endif
EXPECT_EQ(ScreenshotTakerObserver::SCREENSHOT_SUCCESS, screenshot_result_);
if (ScreenshotTakerObserver::SCREENSHOT_SUCCESS == screenshot_result_)
EXPECT_TRUE(base::PathExists(screenshot_path_));
+
+#if defined(OS_CHROMEOS)
+ chromeos::LoginState::Shutdown();
+#endif
}
} // namespace test
« chrome/browser/ui/ash/screenshot_taker.cc ('K') | « 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