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

Side by Side Diff: chrome/browser/ui/panels/test_panel_active_state_observer.h

Issue 10689082: Fix flaky linux panel tests related to active state checks (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove log msg Created 8 years, 5 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 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_UI_PANELS_TEST_PANEL_ACTIVE_STATE_OBSERVER_H_
6 #define CHROME_BROWSER_UI_PANELS_TEST_PANEL_ACTIVE_STATE_OBSERVER_H_
7 #pragma once
8
9 #include "chrome/test/base/ui_test_utils.h"
10
11 class Panel;
12
13 // Custom notification observer for waiting on panel active state.
14 // Modeled after ui_test_utils notification observers.
15 class PanelActiveStateObserver : public content::NotificationObserver {
16 public:
17 // Register to listen for panel active state change notifications
18 // for the specified panel to detect a change to the expected active
19 // state.
20 PanelActiveStateObserver(Panel* panel, bool expect_active);
21 virtual ~PanelActiveStateObserver();
22
23 // Wait until the active state has changed to the expected state.
24 void Wait();
25
26 // content::NotificationObserver:
27 virtual void Observe(int type,
28 const content::NotificationSource& source,
29 const content::NotificationDetails& details) OVERRIDE;
30
31 private:
32 bool AtExpectedState();
33 Panel* panel_;
34 bool expect_active_;
35 bool seen_; // true after transition to expected state has been seen
36 bool running_; // indicates whether message loop is running
37 content::NotificationRegistrar registrar_;
38 scoped_refptr<ui_test_utils::MessageLoopRunner> message_loop_runner_;
39
40 DISALLOW_COPY_AND_ASSIGN(PanelActiveStateObserver);
41 };
42
43 #endif // CHROME_BROWSER_UI_PANELS_TEST_PANEL_ACTIVE_STATE_OBSERVER_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/panels/panel_browsertest.cc ('k') | chrome/browser/ui/panels/test_panel_active_state_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698