OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 "base/files/file_util.h" | 5 #include "base/files/file_util.h" |
6 #include "base/message_loop/message_loop.h" | 6 #include "base/message_loop/message_loop.h" |
7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
8 #include "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 return start_x_position; | 180 return start_x_position; |
181 } | 181 } |
182 | 182 |
183 GURL GetURL(const std::string& filename) { | 183 GURL GetURL(const std::string& filename) { |
184 return ui_test_utils::GetTestUrl( | 184 return ui_test_utils::GetTestUrl( |
185 base::FilePath().AppendASCII("find_in_page"), | 185 base::FilePath().AppendASCII("find_in_page"), |
186 base::FilePath().AppendASCII(filename)); | 186 base::FilePath().AppendASCII(filename)); |
187 } | 187 } |
188 | 188 |
189 void FlushHistoryService() { | 189 void FlushHistoryService() { |
190 HistoryServiceFactory::GetForProfile( | 190 HistoryServiceFactory::GetForProfile(browser()->profile(), |
191 browser()->profile(), Profile::IMPLICIT_ACCESS)->FlushForTest( | 191 ServiceAccessType::IMPLICIT_ACCESS) |
192 base::Bind(&base::MessageLoop::Quit, | 192 ->FlushForTest(base::Bind( |
193 base::Unretained(base::MessageLoop::current()->current()))); | 193 &base::MessageLoop::Quit, |
| 194 base::Unretained(base::MessageLoop::current()->current()))); |
194 content::RunMessageLoop(); | 195 content::RunMessageLoop(); |
195 } | 196 } |
196 }; | 197 }; |
197 | 198 |
198 // This test loads a page with frames and starts FindInPage requests. | 199 // This test loads a page with frames and starts FindInPage requests. |
199 IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, FindInPageFrames) { | 200 IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, FindInPageFrames) { |
200 // First we navigate to our frames page. | 201 // First we navigate to our frames page. |
201 GURL url = GetURL(kFramePage); | 202 GURL url = GetURL(kFramePage); |
202 ui_test_utils::NavigateToURL(browser(), url); | 203 ui_test_utils::NavigateToURL(browser(), url); |
203 | 204 |
(...skipping 1353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1557 | 1558 |
1558 EXPECT_TRUE(chrome::ExecuteCommand(browser_incognito, IDC_FIND_NEXT)); | 1559 EXPECT_TRUE(chrome::ExecuteCommand(browser_incognito, IDC_FIND_NEXT)); |
1559 WebContents* web_contents_incognito = | 1560 WebContents* web_contents_incognito = |
1560 browser_incognito->tab_strip_model()->GetActiveWebContents(); | 1561 browser_incognito->tab_strip_model()->GetActiveWebContents(); |
1561 ui_test_utils::FindInPageNotificationObserver observer( | 1562 ui_test_utils::FindInPageNotificationObserver observer( |
1562 web_contents_incognito); | 1563 web_contents_incognito); |
1563 observer.Wait(); | 1564 observer.Wait(); |
1564 EXPECT_EQ(ASCIIToUTF16("bar"), | 1565 EXPECT_EQ(ASCIIToUTF16("bar"), |
1565 GetFindBarTextForBrowser(browser_incognito)); | 1566 GetFindBarTextForBrowser(browser_incognito)); |
1566 } | 1567 } |
OLD | NEW |