| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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_UI_WEBUI_WEB_UI_TEST_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_WEB_UI_TEST_HANDLER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_WEB_UI_TEST_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_WEB_UI_TEST_HANDLER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" |
| 9 #include "base/string16.h" | 10 #include "base/string16.h" |
| 10 #include "content/browser/webui/web_ui.h" | |
| 11 #include "content/public/browser/notification_observer.h" | 11 #include "content/public/browser/notification_observer.h" |
| 12 #include "content/public/browser/web_ui_message_handler.h" |
| 13 |
| 14 class RenderViewHost; |
| 12 | 15 |
| 13 namespace base { | 16 namespace base { |
| 14 | |
| 15 class ListValue; | 17 class ListValue; |
| 16 | |
| 17 } // namespace base | 18 } // namespace base |
| 18 | 19 |
| 19 // This class registers test framework specific handlers on WebUI objects. | 20 // This class registers test framework specific handlers on WebUI objects. |
| 20 class WebUITestHandler : public WebUIMessageHandler, | 21 class WebUITestHandler : public content::WebUIMessageHandler, |
| 21 public content::NotificationObserver { | 22 public content::NotificationObserver { |
| 22 public: | 23 public: |
| 23 WebUITestHandler(); | 24 WebUITestHandler(); |
| 24 | 25 |
| 25 // Sends a message through |preload_host| with the |js_text| to preload at the | 26 // Sends a message through |preload_host| with the |js_text| to preload at the |
| 26 // appropriate time before the onload call is made. | 27 // appropriate time before the onload call is made. |
| 27 void PreloadJavaScript(const string16& js_text, | 28 void PreloadJavaScript(const string16& js_text, |
| 28 RenderViewHost* preload_host); | 29 RenderViewHost* preload_host); |
| 29 | 30 |
| 30 // Runs |js_text| in this object's WebUI frame. Does not wait for any result. | 31 // Runs |js_text| in this object's WebUI frame. Does not wait for any result. |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 // pass/fail. | 67 // pass/fail. |
| 67 bool run_test_succeeded_; | 68 bool run_test_succeeded_; |
| 68 | 69 |
| 69 // Waiting for a test to finish. | 70 // Waiting for a test to finish. |
| 70 bool is_waiting_; | 71 bool is_waiting_; |
| 71 | 72 |
| 72 DISALLOW_COPY_AND_ASSIGN(WebUITestHandler); | 73 DISALLOW_COPY_AND_ASSIGN(WebUITestHandler); |
| 73 }; | 74 }; |
| 74 | 75 |
| 75 #endif // CHROME_BROWSER_UI_WEBUI_WEB_UI_TEST_HANDLER_H_ | 76 #endif // CHROME_BROWSER_UI_WEBUI_WEB_UI_TEST_HANDLER_H_ |
| OLD | NEW |