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

Side by Side Diff: chrome/browser/ui/android/tab_model/tab_model_list_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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/android/tab_model/tab_model.h" 5 #include "chrome/browser/ui/android/tab_model/tab_model.h"
6 #include "chrome/browser/ui/android/tab_model/tab_model_list.h" 6 #include "chrome/browser/ui/android/tab_model/tab_model_list.h"
7 #include "chrome/test/base/chrome_render_view_host_test_harness.h" 7 #include "chrome/test/base/chrome_render_view_host_test_harness.h"
8 #include "chrome/test/base/testing_profile.h" 8 #include "chrome/test/base/testing_profile.h"
9 #include "content/public/browser/web_contents.h" 9 #include "content/public/browser/web_contents.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 24 matching lines...) Expand all
35 35
36 // A fake value for the current number of tabs. 36 // A fake value for the current number of tabs.
37 int tab_count_; 37 int tab_count_;
38 }; 38 };
39 39
40 // Regression test for http://crbug.com/432685. 40 // Regression test for http://crbug.com/432685.
41 TEST_F(TabModelListTest, TestGetTabModelForWebContents) { 41 TEST_F(TabModelListTest, TestGetTabModelForWebContents) {
42 TestTabModel tab_model(profile()); 42 TestTabModel tab_model(profile());
43 TabModelList::AddTabModel(&tab_model); 43 TabModelList::AddTabModel(&tab_model);
44 44
45 scoped_ptr<content::WebContents> contents(CreateTestWebContents()); 45 std::unique_ptr<content::WebContents> contents(CreateTestWebContents());
46 46
47 // Should not crash when there are no tabs. 47 // Should not crash when there are no tabs.
48 EXPECT_EQ(NULL, TabModelList::GetTabModelForWebContents(contents.get())); 48 EXPECT_EQ(NULL, TabModelList::GetTabModelForWebContents(contents.get()));
49 49
50 // Should not crash when there is an uninitialized tab, i.e. when 50 // Should not crash when there is an uninitialized tab, i.e. when
51 // TabModel::GetTabAt returns NULL. 51 // TabModel::GetTabAt returns NULL.
52 tab_model.tab_count_ = 1; 52 tab_model.tab_count_ = 1;
53 EXPECT_EQ(NULL, TabModelList::GetTabModelForWebContents(contents.get())); 53 EXPECT_EQ(NULL, TabModelList::GetTabModelForWebContents(contents.get()));
54 54
55 TabModelList::RemoveTabModel(&tab_model); 55 TabModelList::RemoveTabModel(&tab_model);
56 } 56 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/android/tab_model/tab_model.h ('k') | chrome/browser/ui/android/toolbar/toolbar_model_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698