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

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

Issue 14027009: Crash when taking screenshot onto Chrome OS Google Drive (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: minor Created 7 years, 8 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 fb3d36263514dd5cec504a6c03f6c2121d48b444..d91ef4a7a929fdda645e25b98bf071298a2ac0ae 100644
--- a/chrome/browser/ui/ash/screenshot_taker_unittest.cc
+++ b/chrome/browser/ui/ash/screenshot_taker_unittest.cc
@@ -63,7 +63,7 @@ class ScreenshotTakerTest : public AshTestBase,
protected:
// ScreenshotTakerTest is a friend of ScreenshotTaker and therefore
- // allowed to set the directory and basename.
+ // allowed to set the directory, basename and profile.
void SetScreenshotDirectoryForTest(
ScreenshotTaker* screenshot_taker,
const base::FilePath& screenshot_directory) {
@@ -74,6 +74,11 @@ class ScreenshotTakerTest : public AshTestBase,
const std::string& screenshot_basename) {
screenshot_taker->SetScreenshotBasenameForTest(screenshot_basename);
}
+ void SetScreenshotProfileForTest(
+ ScreenshotTaker* screenshot_taker,
+ Profile* profile) {
+ screenshot_taker->SetScreenshotProfileForTest(profile);
+ }
void Wait() {
if (screenshot_complete_)
@@ -97,12 +102,13 @@ class ScreenshotTakerTest : public AshTestBase,
TEST_F(ScreenshotTakerTest, TakeScreenshot) {
TestingProfile profile;
- ScreenshotTaker screenshot_taker(&profile);
+ ScreenshotTaker screenshot_taker;
screenshot_taker.AddObserver(this);
base::ScopedTempDir directory;
ASSERT_TRUE(directory.CreateUniqueTempDir());
SetScreenshotDirectoryForTest(&screenshot_taker, directory.path());
SetScreenshotBasenameForTest(&screenshot_taker, "Screenshot");
+ SetScreenshotProfileForTest(&screenshot_taker, &profile);
EXPECT_TRUE(screenshot_taker.CanTakeScreenshot());
@@ -116,7 +122,7 @@ TEST_F(ScreenshotTakerTest, TakeScreenshot) {
#if defined(OS_CHROMEOS)
// Screenshot notifications on Windows not yet turned on.
EXPECT_TRUE(g_browser_process->notification_ui_manager()->DoesIdExist(
- std::string("screenshot_001")));
+ std::string("screenshot")));
g_browser_process->notification_ui_manager()->CancelAll();
#endif
« 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