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/bind.h" | 5 #include "base/bind.h" |
6 #include "base/file_path.h" | 6 #include "base/file_path.h" |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/stringprintf.h" | 9 #include "base/stringprintf.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 FilePath().AppendASCII(test_case)); | 280 FilePath().AppendASCII(test_case)); |
281 return ui_test_utils::GetFileUrlWithQuery(test_file_path, query); | 281 return ui_test_utils::GetFileUrlWithQuery(test_file_path, query); |
282 } | 282 } |
283 | 283 |
284 void RunTest(Browser* browser, | 284 void RunTest(Browser* browser, |
285 const std::string& test_case, | 285 const std::string& test_case, |
286 const std::string& query) { | 286 const std::string& query) { |
287 GURL url = GetTestURL(test_case, query); | 287 GURL url = GetTestURL(test_case, query); |
288 const string16 expected_title = ASCIIToUTF16("OK"); | 288 const string16 expected_title = ASCIIToUTF16("OK"); |
289 ui_test_utils::TitleWatcher title_watcher( | 289 ui_test_utils::TitleWatcher title_watcher( |
290 browser->GetSelectedWebContents(), expected_title); | 290 browser->GetActiveWebContents(), expected_title); |
291 ui_test_utils::NavigateToURL(browser, url); | 291 ui_test_utils::NavigateToURL(browser, url); |
292 string16 final_title = title_watcher.WaitAndGetTitle(); | 292 string16 final_title = title_watcher.WaitAndGetTitle(); |
293 EXPECT_EQ(expected_title, final_title); | 293 EXPECT_EQ(expected_title, final_title); |
294 } | 294 } |
295 | 295 |
296 void RunTest(const std::string& test_case, const std::string& query) { | 296 void RunTest(const std::string& test_case, const std::string& query) { |
297 RunTest(browser(), test_case, query); | 297 RunTest(browser(), test_case, query); |
298 } | 298 } |
299 | 299 |
300 static void CountWorkerProcesses(int *cur_process_count) { | 300 static void CountWorkerProcesses(int *cur_process_count) { |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 // the same worker that was queued in the first window, to ensure it gets | 487 // the same worker that was queued in the first window, to ensure it gets |
488 // connected to the first window too. | 488 // connected to the first window too. |
489 query = StringPrintf("?id=%d", max_workers_per_tab); | 489 query = StringPrintf("?id=%d", max_workers_per_tab); |
490 url = GetTestURL("single_shared_worker.html", query); | 490 url = GetTestURL("single_shared_worker.html", query); |
491 ui_test_utils::NavigateToURLWithDisposition( | 491 ui_test_utils::NavigateToURLWithDisposition( |
492 browser(), url, NEW_FOREGROUND_TAB, | 492 browser(), url, NEW_FOREGROUND_TAB, |
493 ui_test_utils::BROWSER_TEST_WAIT_FOR_TAB); | 493 ui_test_utils::BROWSER_TEST_WAIT_FOR_TAB); |
494 | 494 |
495 ASSERT_TRUE(WaitForWorkerProcessCount(max_workers_per_tab + 1)); | 495 ASSERT_TRUE(WaitForWorkerProcessCount(max_workers_per_tab + 1)); |
496 } | 496 } |
OLD | NEW |