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

Side by Side Diff: chrome/browser/chromeos/login/screenshot_testing_mixin.h

Issue 441263002: Generalizing architecture for screenshot testing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removed debug output Created 6 years, 3 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 unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SCREENSHOT_TESTING_MIXIN_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SCREENSHOT_TESTING_MIXIN_H_
7
8 #include <string>
9
10 #include "base/command_line.h"
11 #include "base/timer/timer.h"
12 #include "chrome/browser/chromeos/login/mixin_based_browser_test.h"
13 #include "chrome/browser/chromeos/login/screenshot_tester.h"
14 #include "content/public/test/browser_test_base.h"
15
16 namespace chromeos {
17
18 // Base mixin class for tests which support testing with screenshots.
19 // Sets up everything required for taking screenshots.
20 // Provides functionality to deal with animation load: screenshots
21 // should be taken only when all the animation is loaded.
22 class ScreenshotTestingMixin : public MixinBasedBrowserTest::Mixin {
23 public:
24 ScreenshotTestingMixin();
25 virtual ~ScreenshotTestingMixin();
26
27 // Override from BrowsertestBase::Mixin.
28 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE;
29
30 // Override from BrowsertestBase::Mixin.
31 virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE;
32
33 // Runs screenshot testing if it is turned on by command line switches.
34 void RunScreenshotTesting(const std::string& test_name);
35
36 private:
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.
39 // That happens due to some properties of compositor.
40 // This method should be used after getting all the necessary notifications
41 // to wait for the actual load of animation.
42 void SynchronizeAnimationLoadWithCompositor();
43
44 // This method exists only because of the current implementation of
45 // SynchronizeAnimationLoadWithCompositor.
46 void HandleAnimationLoad();
47
48 // Required for current implementation of
49 // SynchronizeAnimationLoadWithCompositor()
50 base::OneShotTimer<ScreenshotTestingMixin> timer_;
51 base::Closure animation_waiter_quitter_;
52
53 // Is true if testing with screenshots is turned on with all proper switches.
54 bool enable_test_screenshots_;
55
56 // |screenshot_tester_ | does everything connected with taking, loading and
57 // comparing screenshots
58 ScreenshotTester screenshot_tester_;
59 };
60
61 } // namespace chromeos
62
63 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENSHOT_TESTING_MIXIN_H_
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/login_ui_browsertest.cc ('k') | chrome/browser/chromeos/login/screenshot_testing_mixin.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698