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

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

Issue 2479683006: [Sync] Add support for identifying tabbed activites (Closed)
Patch Set: Rename proto Created 4 years, 1 month 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 (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/android/tab_android.h" 5 #include "chrome/browser/android/tab_android.h"
6 #include "chrome/browser/chrome_notification_types.h" 6 #include "chrome/browser/chrome_notification_types.h"
7 #include "chrome/browser/ui/android/tab_model/tab_model.h" 7 #include "chrome/browser/ui/android/tab_model/tab_model.h"
8 #include "chrome/test/base/testing_profile.h" 8 #include "chrome/test/base/testing_profile.h"
9 #include "content/public/browser/notification_service.h" 9 #include "content/public/browser/notification_service.h"
10 #include "content/public/browser/notification_source.h" 10 #include "content/public/browser/notification_source.h"
(...skipping 26 matching lines...) Expand all
37 content::WebContents* GetWebContentsAt(int index) const override { 37 content::WebContents* GetWebContentsAt(int index) const override {
38 return NULL; 38 return NULL;
39 } 39 }
40 void CreateTab(TabAndroid* parent, 40 void CreateTab(TabAndroid* parent,
41 content::WebContents* web_contents, 41 content::WebContents* web_contents,
42 int parent_tab_id) override {} 42 int parent_tab_id) override {}
43 content::WebContents* CreateNewTabForDevTools(const GURL& url) override { 43 content::WebContents* CreateNewTabForDevTools(const GURL& url) override {
44 return NULL; 44 return NULL;
45 } 45 }
46 bool IsSessionRestoreInProgress() const override { return false; } 46 bool IsSessionRestoreInProgress() const override { return false; }
47 bool IsTabbedActivity() const override { return false; }
47 TabAndroid* GetTabAt(int index) const override { return NULL; } 48 TabAndroid* GetTabAt(int index) const override { return NULL; }
48 void SetActiveIndex(int index) override {} 49 void SetActiveIndex(int index) override {}
49 void CloseTabAt(int index) override {} 50 void CloseTabAt(int index) override {}
50 }; 51 };
51 52
52 TEST_F(TabModelTest, TestProfileHandling) { 53 TEST_F(TabModelTest, TestProfileHandling) {
53 // Construct TabModel with standard Profile. 54 // Construct TabModel with standard Profile.
54 TestingProfile testing_profile; 55 TestingProfile testing_profile;
55 TestTabModel tab_model(&testing_profile); 56 TestTabModel tab_model(&testing_profile);
56 57
(...skipping 22 matching lines...) Expand all
79 EXPECT_EQ(&testing_profile, tab_model.GetProfile()); 80 EXPECT_EQ(&testing_profile, tab_model.GetProfile());
80 EXPECT_TRUE(tab_model.IsOffTheRecord()); 81 EXPECT_TRUE(tab_model.IsOffTheRecord());
81 82
82 // Notify profile is being destroyed and verify pointer is cleared. 83 // Notify profile is being destroyed and verify pointer is cleared.
83 content::NotificationService::current()->Notify( 84 content::NotificationService::current()->Notify(
84 chrome::NOTIFICATION_PROFILE_DESTROYED, 85 chrome::NOTIFICATION_PROFILE_DESTROYED,
85 content::Source<Profile>(&testing_profile), 86 content::Source<Profile>(&testing_profile),
86 content::NotificationService::NoDetails()); 87 content::NotificationService::NoDetails());
87 EXPECT_EQ(NULL, tab_model.GetProfile()); 88 EXPECT_EQ(NULL, tab_model.GetProfile());
88 } 89 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698