Home | History | Annotate | Download | only in webui
      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_WEBUI_BIDI_CHECKER_WEB_UI_TEST_H_
      6 #define CHROME_BROWSER_UI_WEBUI_BIDI_CHECKER_WEB_UI_TEST_H_
      7 
      8 #include "base/command_line.h"
      9 #include "chrome/test/base/web_ui_browser_test.h"
     10 
     11 namespace base {
     12 class WaitableEvent;
     13 }
     14 
     15 // Base class for BidiChecker-based tests. Preloads the BidiChecker JS library
     16 // for each test.
     17 class WebUIBidiCheckerBrowserTest : public WebUIBrowserTest {
     18  public:
     19   virtual ~WebUIBidiCheckerBrowserTest();
     20 
     21   // testing::Test implementation.
     22   virtual void SetUp() OVERRIDE;
     23   virtual void TearDown() OVERRIDE;
     24 
     25  protected:
     26   WebUIBidiCheckerBrowserTest();
     27 
     28   // Runs the Bidi Checker on the given page URL. |is_rtl| should be true when
     29   // the active page locale is RTL.
     30   void RunBidiCheckerOnPage(const std::string& page_url, bool is_rtl);
     31 
     32   // Setup test path.
     33   virtual void SetUpInProcessBrowserTestFixture() OVERRIDE;
     34 
     35  private:
     36   // The command line args used to run the test before being changed in SetUp().
     37   base::CommandLine::StringVector argv_;
     38 };
     39 
     40 // Base class for BidiChecker-based tests that run with an LTR UI.
     41 class WebUIBidiCheckerBrowserTestLTR : public WebUIBidiCheckerBrowserTest {
     42  public:
     43   void RunBidiCheckerOnPage(const std::string& page_url);
     44 };
     45 
     46 // Base class for BidiChecker-based tests that run with an RTL UI.
     47 class WebUIBidiCheckerBrowserTestRTL : public WebUIBidiCheckerBrowserTest {
     48  public:
     49   void RunBidiCheckerOnPage(const std::string& page_url);
     50 
     51  protected:
     52   virtual void SetUpOnMainThread() OVERRIDE;
     53   virtual void CleanUpOnMainThread() OVERRIDE;
     54 
     55   // The app locale before we change it
     56   std::string app_locale_;
     57 };
     58 
     59 #endif  // CHROME_BROWSER_UI_WEBUI_BIDI_CHECKER_WEB_UI_TEST_H_
     60