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 #include "chrome/browser/ui/webui/BidiCheckerWebUITest.h" | 5 #include "chrome/browser/ui/webui/BidiCheckerWebUITest.h" |
6 | 6 |
7 #include "base/base_paths.h" | 7 #include "base/base_paths.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 void WebUIBidiCheckerBrowserTest::SetUpInProcessBrowserTestFixture() { | 39 void WebUIBidiCheckerBrowserTest::SetUpInProcessBrowserTestFixture() { |
40 WebUIBrowserTest::SetUpInProcessBrowserTestFixture(); | 40 WebUIBrowserTest::SetUpInProcessBrowserTestFixture(); |
41 WebUIBrowserTest::AddLibrary(WebUIBidiCheckerLibraryJSPath()); | 41 WebUIBrowserTest::AddLibrary(WebUIBidiCheckerLibraryJSPath()); |
42 WebUIBrowserTest::AddLibrary(FilePath(kBidiCheckerTestsJS)); | 42 WebUIBrowserTest::AddLibrary(FilePath(kBidiCheckerTestsJS)); |
43 } | 43 } |
44 | 44 |
45 void WebUIBidiCheckerBrowserTest::RunBidiCheckerOnPage(const char pageURL[], | 45 void WebUIBidiCheckerBrowserTest::RunBidiCheckerOnPage(const char pageURL[], |
46 bool isRTL) { | 46 bool isRTL) { |
47 ui_test_utils::NavigateToURL(browser(), GURL(pageURL)); | 47 ui_test_utils::NavigateToURL(browser(), GURL(pageURL)); |
48 ASSERT_TRUE(RunJavascriptTest("runBidiChecker", | 48 ASSERT_TRUE(RunJavascriptTest("runBidiChecker", |
49 *Value::CreateStringValue(pageURL), | 49 *base::StringValue::New(pageURL), |
50 *Value::CreateBooleanValue(isRTL))); | 50 *base::BooleanValue::New(isRTL))); |
51 } | 51 } |
52 | 52 |
53 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTest, TestMainHistoryPageLTR) { | 53 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTest, TestMainHistoryPageLTR) { |
54 HistoryService* history_service = | 54 HistoryService* history_service = |
55 browser()->profile()->GetHistoryService(Profile::IMPLICIT_ACCESS); | 55 browser()->profile()->GetHistoryService(Profile::IMPLICIT_ACCESS); |
56 const GURL history_url = GURL("http://www.ynet.co.il"); | 56 const GURL history_url = GURL("http://www.ynet.co.il"); |
57 history_service->AddPage(history_url, history::SOURCE_BROWSED); | 57 history_service->AddPage(history_url, history::SOURCE_BROWSED); |
58 string16 title; | 58 string16 title; |
59 ASSERT_TRUE(UTF8ToUTF16("\xD7\x91\xD7\x93\xD7\x99\xD7\xA7\xD7\x94\x21", | 59 ASSERT_TRUE(UTF8ToUTF16("\xD7\x91\xD7\x93\xD7\x99\xD7\xA7\xD7\x94\x21", |
60 12, | 60 12, |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 "0000"); | 121 "0000"); |
122 | 122 |
123 PersonalDataManager* personal_data_manager = | 123 PersonalDataManager* personal_data_manager = |
124 browser()->profile()->GetPersonalDataManager(); | 124 browser()->profile()->GetPersonalDataManager(); |
125 ASSERT_TRUE(personal_data_manager); | 125 ASSERT_TRUE(personal_data_manager); |
126 | 126 |
127 personal_data_manager->AddProfile(profile); | 127 personal_data_manager->AddProfile(profile); |
128 | 128 |
129 RunBidiCheckerOnPage(url.c_str(), false); | 129 RunBidiCheckerOnPage(url.c_str(), false); |
130 } | 130 } |
OLD | NEW |