| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SCREENSHOT_TESTING_MIXIN_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SCREENSHOT_TESTING_MIXIN_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SCREENSHOT_TESTING_MIXIN_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SCREENSHOT_TESTING_MIXIN_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/timer/timer.h" | 11 #include "base/timer/timer.h" |
| 12 #include "chrome/browser/chromeos/login/mixin_based_browser_test.h" | 12 #include "chrome/browser/chromeos/login/mixin_based_browser_test.h" |
| 13 #include "chrome/browser/chromeos/login/screenshot_tester.h" | 13 #include "chrome/browser/chromeos/login/screenshot_tester.h" |
| 14 #include "content/public/test/browser_test_base.h" | 14 #include "content/public/test/browser_test_base.h" |
| 15 | 15 |
| 16 namespace chromeos { | 16 namespace chromeos { |
| 17 | 17 |
| 18 // Base mixin class for tests which support testing with screenshots. | 18 // Base mixin class for tests which support testing with screenshots. |
| 19 // Sets up everything required for taking screenshots. | 19 // Sets up everything required for taking screenshots. |
| 20 // Provides functionality to deal with animation load: screenshots | 20 // Provides functionality to deal with animation load: screenshots |
| 21 // should be taken only when all the animation is loaded. | 21 // should be taken only when all the animation is loaded. |
| 22 class ScreenshotTestingMixin : public MixinBasedBrowserTest::Mixin { | 22 class ScreenshotTestingMixin : public MixinBasedBrowserTest::Mixin { |
| 23 public: | 23 public: |
| 24 ScreenshotTestingMixin(); | 24 ScreenshotTestingMixin(); |
| 25 virtual ~ScreenshotTestingMixin(); | 25 virtual ~ScreenshotTestingMixin(); |
| 26 | 26 |
| 27 // Override from BrowsertestBase::Mixin. | 27 // Override from BrowsertestBase::Mixin. |
| 28 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE; | 28 virtual void SetUpInProcessBrowserTestFixture() override; |
| 29 | 29 |
| 30 // Override from BrowsertestBase::Mixin. | 30 // Override from BrowsertestBase::Mixin. |
| 31 virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE; | 31 virtual void SetUpCommandLine(base::CommandLine* command_line) override; |
| 32 | 32 |
| 33 // Runs screenshot testing if it is turned on by command line switches. | 33 // Runs screenshot testing if it is turned on by command line switches. |
| 34 void RunScreenshotTesting(const std::string& test_name); | 34 void RunScreenshotTesting(const std::string& test_name); |
| 35 | 35 |
| 36 private: | 36 private: |
| 37 // It turns out that it takes some more time for the animation | 37 // It turns out that it takes some more time for the animation |
| 38 // to finish loading even after all the notifications have been sent. | 38 // to finish loading even after all the notifications have been sent. |
| 39 // That happens due to some properties of compositor. | 39 // That happens due to some properties of compositor. |
| 40 // This method should be used after getting all the necessary notifications | 40 // This method should be used after getting all the necessary notifications |
| 41 // to wait for the actual load of animation. | 41 // to wait for the actual load of animation. |
| (...skipping 12 matching lines...) Expand all Loading... |
| 54 bool enable_test_screenshots_; | 54 bool enable_test_screenshots_; |
| 55 | 55 |
| 56 // |screenshot_tester_ | does everything connected with taking, loading and | 56 // |screenshot_tester_ | does everything connected with taking, loading and |
| 57 // comparing screenshots | 57 // comparing screenshots |
| 58 ScreenshotTester screenshot_tester_; | 58 ScreenshotTester screenshot_tester_; |
| 59 }; | 59 }; |
| 60 | 60 |
| 61 } // namespace chromeos | 61 } // namespace chromeos |
| 62 | 62 |
| 63 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENSHOT_TESTING_MIXIN_H_ | 63 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENSHOT_TESTING_MIXIN_H_ |
| OLD | NEW |