| 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/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/files/file_util.h" | 6 #include "base/files/file_util.h" |
| 7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 GURL GetURL(const std::string& filename) { | 191 GURL GetURL(const std::string& filename) { |
| 192 return ui_test_utils::GetTestUrl( | 192 return ui_test_utils::GetTestUrl( |
| 193 base::FilePath().AppendASCII("find_in_page"), | 193 base::FilePath().AppendASCII("find_in_page"), |
| 194 base::FilePath().AppendASCII(filename)); | 194 base::FilePath().AppendASCII(filename)); |
| 195 } | 195 } |
| 196 | 196 |
| 197 void FlushHistoryService() { | 197 void FlushHistoryService() { |
| 198 HistoryServiceFactory::GetForProfile(browser()->profile(), | 198 HistoryServiceFactory::GetForProfile(browser()->profile(), |
| 199 ServiceAccessType::IMPLICIT_ACCESS) | 199 ServiceAccessType::IMPLICIT_ACCESS) |
| 200 ->FlushForTest(base::Bind( | 200 ->FlushForTest(base::Bind( |
| 201 &base::MessageLoop::Quit, | 201 &base::MessageLoop::QuitWhenIdle, |
| 202 base::Unretained(base::MessageLoop::current()->current()))); | 202 base::Unretained(base::MessageLoop::current()->current()))); |
| 203 content::RunMessageLoop(); | 203 content::RunMessageLoop(); |
| 204 } | 204 } |
| 205 }; | 205 }; |
| 206 | 206 |
| 207 // This test loads a page with frames and starts FindInPage requests. | 207 // This test loads a page with frames and starts FindInPage requests. |
| 208 IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, FindInPageFrames) { | 208 IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, FindInPageFrames) { |
| 209 // First we navigate to our frames page. | 209 // First we navigate to our frames page. |
| 210 GURL url = GetURL(kFramePage); | 210 GURL url = GetURL(kFramePage); |
| 211 ui_test_utils::NavigateToURL(browser(), url); | 211 ui_test_utils::NavigateToURL(browser(), url); |
| (...skipping 1354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1566 | 1566 |
| 1567 EXPECT_TRUE(chrome::ExecuteCommand(browser_incognito, IDC_FIND_NEXT)); | 1567 EXPECT_TRUE(chrome::ExecuteCommand(browser_incognito, IDC_FIND_NEXT)); |
| 1568 WebContents* web_contents_incognito = | 1568 WebContents* web_contents_incognito = |
| 1569 browser_incognito->tab_strip_model()->GetActiveWebContents(); | 1569 browser_incognito->tab_strip_model()->GetActiveWebContents(); |
| 1570 ui_test_utils::FindInPageNotificationObserver observer( | 1570 ui_test_utils::FindInPageNotificationObserver observer( |
| 1571 web_contents_incognito); | 1571 web_contents_incognito); |
| 1572 observer.Wait(); | 1572 observer.Wait(); |
| 1573 EXPECT_EQ(ASCIIToUTF16("bar"), | 1573 EXPECT_EQ(ASCIIToUTF16("bar"), |
| 1574 GetFindBarTextForBrowser(browser_incognito)); | 1574 GetFindBarTextForBrowser(browser_incognito)); |
| 1575 } | 1575 } |
| OLD | NEW |