| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 base::FilePath().AppendASCII("session_history"), | 93 base::FilePath().AppendASCII("session_history"), |
| 94 base::FilePath().AppendASCII("bot1.html")); | 94 base::FilePath().AppendASCII("bot1.html")); |
| 95 url2_ = ui_test_utils::GetTestUrl( | 95 url2_ = ui_test_utils::GetTestUrl( |
| 96 base::FilePath().AppendASCII("session_history"), | 96 base::FilePath().AppendASCII("session_history"), |
| 97 base::FilePath().AppendASCII("bot2.html")); | 97 base::FilePath().AppendASCII("bot2.html")); |
| 98 } | 98 } |
| 99 | 99 |
| 100 protected: | 100 protected: |
| 101 void SetUpOnMainThread() override { | 101 void SetUpOnMainThread() override { |
| 102 active_browser_list_ = BrowserList::GetInstance(); | 102 active_browser_list_ = BrowserList::GetInstance(); |
| 103 InProcessBrowserTest::SetUpOnMainThread(); | |
| 104 } | 103 } |
| 105 | 104 |
| 106 Browser* GetBrowser(int index) { | 105 Browser* GetBrowser(int index) { |
| 107 CHECK(static_cast<int>(active_browser_list_->size()) > index); | 106 CHECK(static_cast<int>(active_browser_list_->size()) > index); |
| 108 return active_browser_list_->get(index); | 107 return active_browser_list_->get(index); |
| 109 } | 108 } |
| 110 | 109 |
| 111 // Adds tabs to the given browser, all navigated to url1_. Returns | 110 // Adds tabs to the given browser, all navigated to url1_. Returns |
| 112 // the final number of tabs. | 111 // the final number of tabs. |
| 113 int AddSomeTabs(Browser* browser, int how_many) { | 112 int AddSomeTabs(Browser* browser, int how_many) { |
| (...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 808 content::RunAllPendingInMessageLoop(); | 807 content::RunAllPendingInMessageLoop(); |
| 809 | 808 |
| 810 // These tabs shouldn't want to be loaded. | 809 // These tabs shouldn't want to be loaded. |
| 811 for (int tab_idx = 1; tab_idx < tabs_count - 1; ++tab_idx) { | 810 for (int tab_idx = 1; tab_idx < tabs_count - 1; ++tab_idx) { |
| 812 auto* contents = browser2->tab_strip_model()->GetWebContentsAt(tab_idx); | 811 auto* contents = browser2->tab_strip_model()->GetWebContentsAt(tab_idx); |
| 813 EXPECT_FALSE(contents->IsLoading()); | 812 EXPECT_FALSE(contents->IsLoading()); |
| 814 EXPECT_TRUE(contents->GetController().NeedsReload()); | 813 EXPECT_TRUE(contents->GetController().NeedsReload()); |
| 815 } | 814 } |
| 816 } | 815 } |
| 817 #endif // BUILDFLAG(ENABLE_SESSION_SERVICE) | 816 #endif // BUILDFLAG(ENABLE_SESSION_SERVICE) |
| OLD | NEW |