| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/ash/chrome_screenshot_grabber.h" | 5 #include "chrome/browser/ui/ash/chrome_screenshot_grabber.h" |
| 6 | 6 |
| 7 #include "ash/common/accelerators/accelerator_controller.h" | 7 #include "ash/common/accelerators/accelerator_controller.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "ash/test/ash_test_base.h" | 9 #include "ash/test/ash_test_base.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 bool screenshot_complete_; | 95 bool screenshot_complete_; |
| 96 ScreenshotGrabberObserver::Result screenshot_result_; | 96 ScreenshotGrabberObserver::Result screenshot_result_; |
| 97 std::unique_ptr<ChromeScreenshotGrabber> chrome_screenshot_grabber_; | 97 std::unique_ptr<ChromeScreenshotGrabber> chrome_screenshot_grabber_; |
| 98 base::FilePath screenshot_path_; | 98 base::FilePath screenshot_path_; |
| 99 scoped_refptr<content::MessageLoopRunner> message_loop_runner_; | 99 scoped_refptr<content::MessageLoopRunner> message_loop_runner_; |
| 100 | 100 |
| 101 private: | 101 private: |
| 102 DISALLOW_COPY_AND_ASSIGN(ChromeScreenshotGrabberTest); | 102 DISALLOW_COPY_AND_ASSIGN(ChromeScreenshotGrabberTest); |
| 103 }; | 103 }; |
| 104 | 104 |
| 105 TEST_F(ChromeScreenshotGrabberTest, TakeScreenshot) { | 105 // Flaky on "Linux ChromiumOS Tests (dbg)(1)". See http://crbug.com/645864. |
| 106 TEST_F(ChromeScreenshotGrabberTest, DISABLED_TakeScreenshot) { |
| 106 // Note that within the test framework the LoginState object will always | 107 // Note that within the test framework the LoginState object will always |
| 107 // claim that the user did log in. | 108 // claim that the user did log in. |
| 108 ASSERT_FALSE(chromeos::LoginState::IsInitialized()); | 109 ASSERT_FALSE(chromeos::LoginState::IsInitialized()); |
| 109 chromeos::LoginState::Initialize(); | 110 chromeos::LoginState::Initialize(); |
| 110 chromeos::ScopedUserManagerEnabler scoped_enabler( | 111 chromeos::ScopedUserManagerEnabler scoped_enabler( |
| 111 new chromeos::MockUserManager()); | 112 new chromeos::MockUserManager()); |
| 112 base::ScopedTempDir directory; | 113 base::ScopedTempDir directory; |
| 113 ASSERT_TRUE(directory.CreateUniqueTempDir()); | 114 ASSERT_TRUE(directory.CreateUniqueTempDir()); |
| 114 EXPECT_TRUE(chrome_screenshot_grabber()->CanTakeScreenshot()); | 115 EXPECT_TRUE(chrome_screenshot_grabber()->CanTakeScreenshot()); |
| 115 | 116 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 130 EXPECT_EQ(ScreenshotGrabberObserver::SCREENSHOT_SUCCESS, screenshot_result_); | 131 EXPECT_EQ(ScreenshotGrabberObserver::SCREENSHOT_SUCCESS, screenshot_result_); |
| 131 | 132 |
| 132 if (ScreenshotGrabberObserver::SCREENSHOT_SUCCESS == screenshot_result_) | 133 if (ScreenshotGrabberObserver::SCREENSHOT_SUCCESS == screenshot_result_) |
| 133 EXPECT_TRUE(base::PathExists(screenshot_path_)); | 134 EXPECT_TRUE(base::PathExists(screenshot_path_)); |
| 134 | 135 |
| 135 chromeos::LoginState::Shutdown(); | 136 chromeos::LoginState::Shutdown(); |
| 136 } | 137 } |
| 137 | 138 |
| 138 } // namespace test | 139 } // namespace test |
| 139 } // namespace ash | 140 } // namespace ash |
| OLD | NEW |