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 "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 23 matching lines...) Expand all Loading... |
34 virtual content::WebContents* GetWebContentsAt(int index) const OVERRIDE { | 34 virtual content::WebContents* GetWebContentsAt(int index) const OVERRIDE { |
35 return NULL; | 35 return NULL; |
36 } | 36 } |
37 virtual void CreateTab(content::WebContents* web_contents, | 37 virtual void CreateTab(content::WebContents* web_contents, |
38 int parent_tab_id) OVERRIDE {} | 38 int parent_tab_id) OVERRIDE {} |
39 virtual content::WebContents* CreateNewTabForDevTools( | 39 virtual content::WebContents* CreateNewTabForDevTools( |
40 const GURL& url) OVERRIDE { | 40 const GURL& url) OVERRIDE { |
41 return NULL; | 41 return NULL; |
42 } | 42 } |
43 virtual bool IsSessionRestoreInProgress() const OVERRIDE { return false; } | 43 virtual bool IsSessionRestoreInProgress() const OVERRIDE { return false; } |
44 virtual void OpenClearBrowsingData() const OVERRIDE {} | |
45 virtual TabAndroid* GetTabAt(int index) const OVERRIDE { | 44 virtual TabAndroid* GetTabAt(int index) const OVERRIDE { |
46 return NULL; | 45 return NULL; |
47 } | 46 } |
48 virtual void SetActiveIndex(int index) OVERRIDE {} | 47 virtual void SetActiveIndex(int index) OVERRIDE {} |
49 virtual void CloseTabAt(int index) OVERRIDE {} | 48 virtual void CloseTabAt(int index) OVERRIDE {} |
50 }; | 49 }; |
51 | 50 |
52 TEST_F(TabModelTest, TestProfileHandling) { | 51 TEST_F(TabModelTest, TestProfileHandling) { |
53 // Construct TabModel with standard Profile. | 52 // Construct TabModel with standard Profile. |
54 TestingProfile testing_profile; | 53 TestingProfile testing_profile; |
(...skipping 24 matching lines...) Expand all Loading... |
79 EXPECT_EQ(&testing_profile, tab_model.GetProfile()); | 78 EXPECT_EQ(&testing_profile, tab_model.GetProfile()); |
80 EXPECT_TRUE(tab_model.IsOffTheRecord()); | 79 EXPECT_TRUE(tab_model.IsOffTheRecord()); |
81 | 80 |
82 // Notify profile is being destroyed and verify pointer is cleared. | 81 // Notify profile is being destroyed and verify pointer is cleared. |
83 content::NotificationService::current()->Notify( | 82 content::NotificationService::current()->Notify( |
84 chrome::NOTIFICATION_PROFILE_DESTROYED, | 83 chrome::NOTIFICATION_PROFILE_DESTROYED, |
85 content::Source<Profile>(&testing_profile), | 84 content::Source<Profile>(&testing_profile), |
86 content::NotificationService::NoDetails()); | 85 content::NotificationService::NoDetails()); |
87 EXPECT_EQ(NULL, tab_model.GetProfile()); | 86 EXPECT_EQ(NULL, tab_model.GetProfile()); |
88 } | 87 } |
OLD | NEW |