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

Side by Side Diff: chrome/browser/ui/android/tab_model/tab_model_unittest.cc

Issue 15055003: Do not submit: high level overview patch. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix build. Created 7 years, 7 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 | Annotate | Revision Log
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/android/tab_model/tab_model.h" 5 #include "chrome/browser/ui/android/tab_model/tab_model.h"
6 #include "chrome/common/chrome_notification_types.h" 6 #include "chrome/common/chrome_notification_types.h"
7 #include "chrome/test/base/testing_profile.h" 7 #include "chrome/test/base/testing_profile.h"
8 #include "content/public/browser/notification_service.h" 8 #include "content/public/browser/notification_service.h"
9 #include "content/public/browser/notification_source.h" 9 #include "content/public/browser/notification_source.h"
10 #include "testing/gmock/include/gmock/gmock.h" 10 #include "testing/gmock/include/gmock/gmock.h"
(...skipping 15 matching lines...) Expand all
26 class TestTabModel : public TabModel { 26 class TestTabModel : public TabModel {
27 public: 27 public:
28 explicit TestTabModel(Profile* profile) 28 explicit TestTabModel(Profile* profile)
29 : TabModel(profile) {} 29 : TabModel(profile) {}
30 30
31 int GetTabCount() const OVERRIDE { return 0; } 31 int GetTabCount() const OVERRIDE { return 0; }
32 int GetActiveIndex() const OVERRIDE { return 0; } 32 int GetActiveIndex() const OVERRIDE { return 0; }
33 content::WebContents* GetWebContentsAt(int index) const OVERRIDE { 33 content::WebContents* GetWebContentsAt(int index) const OVERRIDE {
34 return NULL; 34 return NULL;
35 } 35 }
36 SessionID::id_type GetTabIdAt(int index) const OVERRIDE { return 0; } 36 browser_sync::SyncedTabDelegate* GetTabAt(int index) const OVERRIDE {
37 return NULL;
38 }
39
37 void CreateTab(content::WebContents* web_contents) OVERRIDE {} 40 void CreateTab(content::WebContents* web_contents) OVERRIDE {}
38 bool IsSessionRestoreInProgress() const OVERRIDE { return false; } 41 bool IsSessionRestoreInProgress() const OVERRIDE { return false; }
39 void OpenClearBrowsingData() const OVERRIDE {} 42 void OpenClearBrowsingData() const OVERRIDE {}
40 }; 43 };
41 44
42 TEST_F(TabModelTest, TestProfileHandling) { 45 TEST_F(TabModelTest, TestProfileHandling) {
43 // Construct TabModel with standard Profile. 46 // Construct TabModel with standard Profile.
44 TestingProfile testing_profile; 47 TestingProfile testing_profile;
45 TestTabModel tab_model(&testing_profile); 48 TestTabModel tab_model(&testing_profile);
46 49
(...skipping 22 matching lines...) Expand all
69 EXPECT_EQ(&testing_profile, tab_model.GetProfile()); 72 EXPECT_EQ(&testing_profile, tab_model.GetProfile());
70 EXPECT_TRUE(tab_model.IsOffTheRecord()); 73 EXPECT_TRUE(tab_model.IsOffTheRecord());
71 74
72 // Notify profile is being destroyed and verify pointer is cleared. 75 // Notify profile is being destroyed and verify pointer is cleared.
73 content::NotificationService::current()->Notify( 76 content::NotificationService::current()->Notify(
74 chrome::NOTIFICATION_PROFILE_DESTROYED, 77 chrome::NOTIFICATION_PROFILE_DESTROYED,
75 content::Source<Profile>(&testing_profile), 78 content::Source<Profile>(&testing_profile),
76 content::NotificationService::NoDetails()); 79 content::NotificationService::NoDetails());
77 EXPECT_EQ(NULL, tab_model.GetProfile()); 80 EXPECT_EQ(NULL, tab_model.GetProfile());
78 } 81 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698