OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2011 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_TEST_TEST_HTML_DIALOG_OBSERVER_H_ | |
6 #define CHROME_TEST_TEST_HTML_DIALOG_OBSERVER_H_ | |
7 #pragma once | |
8 | |
9 #include "content/common/notification_observer.h" | |
10 #include "content/common/notification_registrar.h" | |
11 | |
12 class WebUI; | |
13 | |
14 // For browser_tests, which run on the UI thread, run a second message | |
15 // MessageLoop to detect HtmlDialog creation and quit when the constructed | |
16 // WebUI instance is captured and ready. | |
17 class TestHtmlDialogObserver : public NotificationObserver { | |
18 public: | |
19 // Create and register a new TestHtmlDialogObserver. | |
20 TestHtmlDialogObserver(); | |
21 virtual ~TestHtmlDialogObserver(); | |
22 | |
23 // Waits for an HtmlDialog to be created. The WebUI instance is captured | |
24 // and the method returns it when the navigation on the dialog is complete. | |
25 WebUI* GetWebUI(); | |
26 | |
27 private: | |
28 // NotificationObserver: | |
29 virtual void Observe(int type, const NotificationSource& source, | |
30 const NotificationDetails& details); | |
31 | |
32 NotificationRegistrar registrar_; | |
33 | |
34 WebUI* web_ui_; | |
35 bool done_; | |
36 bool running_; | |
37 }; | |
Sheridan Rawlins
2011/09/15 19:11:41
DISALLOW_COPY_AND_ASSIGN(TestHtmlDialogObserver);
flackr
2011/09/15 21:02:36
Done.
| |
38 | |
39 #endif // CHROME_TEST_TEST_HTML_DIALOG_OBSERVER_H_ | |
OLD | NEW |