Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(413)

Side by Side Diff: chrome/browser/ui/tab_contents/tab_contents_iterator_unittest.cc

Issue 1865213004: Convert //chrome/browser/ui from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/sync/sync_promo_ui_unittest.cc ('k') | chrome/browser/ui/tab_dialogs.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "chrome/browser/ui/tab_contents/tab_contents_iterator.h" 5 #include "chrome/browser/ui/tab_contents/tab_contents_iterator.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 26 matching lines...) Expand all
37 } // namespace 37 } // namespace
38 38
39 TEST_F(BrowserListTest, TabContentsIteratorVerifyCount) { 39 TEST_F(BrowserListTest, TabContentsIteratorVerifyCount) {
40 // Make sure we have 1 window to start with. 40 // Make sure we have 1 window to start with.
41 EXPECT_EQ(1U, BrowserList::GetInstance()->size()); 41 EXPECT_EQ(1U, BrowserList::GetInstance()->size());
42 42
43 EXPECT_EQ(0U, CountAllTabs()); 43 EXPECT_EQ(0U, CountAllTabs());
44 44
45 // Create more browsers/windows. 45 // Create more browsers/windows.
46 Browser::CreateParams native_params(profile()); 46 Browser::CreateParams native_params(profile());
47 scoped_ptr<Browser> browser2( 47 std::unique_ptr<Browser> browser2(
48 chrome::CreateBrowserWithTestWindowForParams(&native_params)); 48 chrome::CreateBrowserWithTestWindowForParams(&native_params));
49 // Create browser 3 and 4 on the Ash desktop (the TabContentsIterator 49 // Create browser 3 and 4 on the Ash desktop (the TabContentsIterator
50 // shouldn't see the difference). 50 // shouldn't see the difference).
51 Browser::CreateParams ash_params(profile()); 51 Browser::CreateParams ash_params(profile());
52 scoped_ptr<Browser> browser3( 52 std::unique_ptr<Browser> browser3(
53 chrome::CreateBrowserWithTestWindowForParams(&ash_params)); 53 chrome::CreateBrowserWithTestWindowForParams(&ash_params));
54 scoped_ptr<Browser> browser4( 54 std::unique_ptr<Browser> browser4(
55 chrome::CreateBrowserWithTestWindowForParams(&ash_params)); 55 chrome::CreateBrowserWithTestWindowForParams(&ash_params));
56 56
57 // Sanity checks. 57 // Sanity checks.
58 EXPECT_EQ(4U, BrowserList::GetInstance()->size()); 58 EXPECT_EQ(4U, BrowserList::GetInstance()->size());
59 EXPECT_EQ(0, browser()->tab_strip_model()->count()); 59 EXPECT_EQ(0, browser()->tab_strip_model()->count());
60 EXPECT_EQ(0, browser2->tab_strip_model()->count()); 60 EXPECT_EQ(0, browser2->tab_strip_model()->count());
61 EXPECT_EQ(0, browser3->tab_strip_model()->count()); 61 EXPECT_EQ(0, browser3->tab_strip_model()->count());
62 EXPECT_EQ(0, browser4->tab_strip_model()->count()); 62 EXPECT_EQ(0, browser4->tab_strip_model()->count());
63 63
64 EXPECT_EQ(0U, CountAllTabs()); 64 EXPECT_EQ(0U, CountAllTabs());
(...skipping 18 matching lines...) Expand all
83 // Close all remaining tabs to keep all the destructors happy. 83 // Close all remaining tabs to keep all the destructors happy.
84 browser3->tab_strip_model()->CloseAllTabs(); 84 browser3->tab_strip_model()->CloseAllTabs();
85 } 85 }
86 86
87 TEST_F(BrowserListTest, TabContentsIteratorVerifyBrowser) { 87 TEST_F(BrowserListTest, TabContentsIteratorVerifyBrowser) {
88 // Make sure we have 1 window to start with. 88 // Make sure we have 1 window to start with.
89 EXPECT_EQ(1U, BrowserList::GetInstance()->size()); 89 EXPECT_EQ(1U, BrowserList::GetInstance()->size());
90 90
91 // Create more browsers/windows. 91 // Create more browsers/windows.
92 Browser::CreateParams native_params(profile()); 92 Browser::CreateParams native_params(profile());
93 scoped_ptr<Browser> browser2( 93 std::unique_ptr<Browser> browser2(
94 chrome::CreateBrowserWithTestWindowForParams(&native_params)); 94 chrome::CreateBrowserWithTestWindowForParams(&native_params));
95 // Create browser 3 on the Ash desktop (the TabContentsIterator shouldn't see 95 // Create browser 3 on the Ash desktop (the TabContentsIterator shouldn't see
96 // the difference). 96 // the difference).
97 Browser::CreateParams ash_params(profile()); 97 Browser::CreateParams ash_params(profile());
98 scoped_ptr<Browser> browser3( 98 std::unique_ptr<Browser> browser3(
99 chrome::CreateBrowserWithTestWindowForParams(&ash_params)); 99 chrome::CreateBrowserWithTestWindowForParams(&ash_params));
100 100
101 // Sanity checks. 101 // Sanity checks.
102 EXPECT_EQ(3U, BrowserList::GetInstance()->size()); 102 EXPECT_EQ(3U, BrowserList::GetInstance()->size());
103 EXPECT_EQ(0, browser()->tab_strip_model()->count()); 103 EXPECT_EQ(0, browser()->tab_strip_model()->count());
104 EXPECT_EQ(0, browser2->tab_strip_model()->count()); 104 EXPECT_EQ(0, browser2->tab_strip_model()->count());
105 EXPECT_EQ(0, browser3->tab_strip_model()->count()); 105 EXPECT_EQ(0, browser3->tab_strip_model()->count());
106 106
107 EXPECT_EQ(0U, CountAllTabs()); 107 EXPECT_EQ(0U, CountAllTabs());
108 108
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 testing_browser_process->SetProfileManager(profile_manager); 184 testing_browser_process->SetProfileManager(profile_manager);
185 185
186 chrome::AttemptRestart(); 186 chrome::AttemptRestart();
187 // Cancel the effects of us calling chrome::AttemptRestart. Otherwise tests 187 // Cancel the effects of us calling chrome::AttemptRestart. Otherwise tests
188 // ran after this one will fail. 188 // ran after this one will fail.
189 browser_shutdown::SetTryingToQuit(false); 189 browser_shutdown::SetTryingToQuit(false);
190 190
191 EXPECT_TRUE(testing_pref_service.GetBoolean(prefs::kWasRestarted)); 191 EXPECT_TRUE(testing_pref_service.GetBoolean(prefs::kWasRestarted));
192 testing_browser_process->SetLocalState(NULL); 192 testing_browser_process->SetLocalState(NULL);
193 } 193 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/sync/sync_promo_ui_unittest.cc ('k') | chrome/browser/ui/tab_dialogs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698