Chromium Code Reviews| 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_BIDI_CHECKER_WEB_UI_TEST_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_BIDI_CHECKER_WEB_UI_TEST_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_BIDI_CHECKER_WEB_UI_TEST_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_BIDI_CHECKER_WEB_UI_TEST_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "chrome/browser/ui/webui/web_ui_browsertest.h" | 9 #include "chrome/browser/ui/webui/web_ui_browsertest.h" |
| 10 #include "chrome/test/base/in_process_browser_test.h" | 10 #include "chrome/test/base/in_process_browser_test.h" |
| 11 | 11 |
| 12 // Base class for BidiChecker-based tests. Preloads the BidiChecker JS library | 12 // Base class for BidiChecker-based tests. Preloads the BidiChecker JS library |
| 13 // for each test. | 13 // for each test. |
| 14 class WebUIBidiCheckerBrowserTest : public WebUIBrowserTest { | 14 class WebUIBidiCheckerBrowserTest : public WebUIBrowserTest { |
| 15 public: | 15 public: |
| 16 virtual ~WebUIBidiCheckerBrowserTest(); | 16 virtual ~WebUIBidiCheckerBrowserTest(); |
| 17 | 17 |
| 18 // Runs the Bidi Checker on the given page URL. |isRTL| should be true when | 18 // Runs the Bidi Checker on the given page URL. |isRTL| should be true when |
| 19 // the active page locale is RTL. | 19 // the active page locale is RTL. |
| 20 void RunBidiCheckerOnPage(const char pageURL[], bool isRTL); | 20 void RunBidiCheckerOnPage(const char pageURL[], bool isRTL); |
| 21 // Same as above but automatically sets the |isRTL| flag. | |
| 22 virtual void RunBidiCheckerOnPage(const char pageURL[]); | |
|
jeremy
2011/10/16 12:54:59
I would just define 2 functions and make the above
| |
| 21 | 23 |
| 22 protected: | 24 protected: |
| 23 WebUIBidiCheckerBrowserTest(); | 25 WebUIBidiCheckerBrowserTest(); |
| 24 | 26 |
| 25 // Setup test path. | 27 // Setup test path. |
| 26 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE; | 28 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE; |
| 27 }; | 29 }; |
| 28 | 30 |
| 29 // Base class for BidiChecker-based tests that run with an RTL UI. | 31 // Base class for BidiChecker-based tests that run with an RTL UI. |
| 30 // Preloads the BidiChecker JS library for each test, as well as modifies the | 32 // Preloads the BidiChecker JS library for each test, as well as modifies the |
| 31 // active language. | 33 // active language. |
| 32 class WebUIBidiCheckerBrowserTestFakeBidi : public WebUIBidiCheckerBrowserTest { | 34 class WebUIBidiCheckerBrowserTestFakeBidi : public WebUIBidiCheckerBrowserTest { |
| 33 public: | 35 public: |
| 34 virtual ~WebUIBidiCheckerBrowserTestFakeBidi(); | 36 virtual ~WebUIBidiCheckerBrowserTestFakeBidi(); |
| 37 virtual void RunBidiCheckerOnPage(const char pageURL[]); | |
|
jeremy
2011/10/16 12:54:59
specify OVERRIDE in the function definition.
| |
| 35 | 38 |
| 36 protected: | 39 protected: |
| 37 WebUIBidiCheckerBrowserTestFakeBidi(); | 40 WebUIBidiCheckerBrowserTestFakeBidi(); |
| 38 | 41 |
| 39 virtual void SetUpOnMainThread() OVERRIDE; | 42 virtual void SetUpOnMainThread() OVERRIDE; |
| 40 virtual void CleanUpOnMainThread() OVERRIDE; | 43 virtual void CleanUpOnMainThread() OVERRIDE; |
| 41 | 44 |
| 42 // The app locale before we change it | 45 // The app locale before we change it |
| 43 std::string app_locale_; | 46 std::string app_locale_; |
| 44 }; | 47 }; |
| 45 | 48 |
| 46 #endif // CHROME_BROWSER_UI_WEBUI_BIDI_CHECKER_WEB_UI_TEST_H_ | 49 #endif // CHROME_BROWSER_UI_WEBUI_BIDI_CHECKER_WEB_UI_TEST_H_ |
| OLD | NEW |