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

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

Issue 103213015: Pass through the parent_tab_id when creating a new tab. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updated the unittest Created 6 years, 11 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
« no previous file with comments | « chrome/browser/ui/android/tab_model/tab_model.h ('k') | no next file » | 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/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 16 matching lines...) Expand all
27 class TestTabModel : public TabModel { 27 class TestTabModel : public TabModel {
28 public: 28 public:
29 explicit TestTabModel(Profile* profile) 29 explicit TestTabModel(Profile* profile)
30 : TabModel(profile) {} 30 : TabModel(profile) {}
31 31
32 virtual int GetTabCount() const OVERRIDE { return 0; } 32 virtual int GetTabCount() const OVERRIDE { return 0; }
33 virtual int GetActiveIndex() const OVERRIDE { return 0; } 33 virtual int GetActiveIndex() const OVERRIDE { return 0; }
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) OVERRIDE {} 37 virtual void CreateTab(content::WebContents* web_contents,
38 int parent_tab_id) OVERRIDE {}
38 virtual content::WebContents* CreateNewTabForDevTools( 39 virtual content::WebContents* CreateNewTabForDevTools(
39 const GURL& url) OVERRIDE { 40 const GURL& url) OVERRIDE {
40 return NULL; 41 return NULL;
41 } 42 }
42 virtual bool IsSessionRestoreInProgress() const OVERRIDE { return false; } 43 virtual bool IsSessionRestoreInProgress() const OVERRIDE { return false; }
43 virtual void OpenClearBrowsingData() const OVERRIDE {} 44 virtual void OpenClearBrowsingData() const OVERRIDE {}
44 virtual TabAndroid* GetTabAt(int index) const OVERRIDE { 45 virtual TabAndroid* GetTabAt(int index) const OVERRIDE {
45 return NULL; 46 return NULL;
46 } 47 }
47 virtual void SetActiveIndex(int index) OVERRIDE {} 48 virtual void SetActiveIndex(int index) OVERRIDE {}
(...skipping 30 matching lines...) Expand all
78 EXPECT_EQ(&testing_profile, tab_model.GetProfile()); 79 EXPECT_EQ(&testing_profile, tab_model.GetProfile());
79 EXPECT_TRUE(tab_model.IsOffTheRecord()); 80 EXPECT_TRUE(tab_model.IsOffTheRecord());
80 81
81 // Notify profile is being destroyed and verify pointer is cleared. 82 // Notify profile is being destroyed and verify pointer is cleared.
82 content::NotificationService::current()->Notify( 83 content::NotificationService::current()->Notify(
83 chrome::NOTIFICATION_PROFILE_DESTROYED, 84 chrome::NOTIFICATION_PROFILE_DESTROYED,
84 content::Source<Profile>(&testing_profile), 85 content::Source<Profile>(&testing_profile),
85 content::NotificationService::NoDetails()); 86 content::NotificationService::NoDetails());
86 EXPECT_EQ(NULL, tab_model.GetProfile()); 87 EXPECT_EQ(NULL, tab_model.GetProfile());
87 } 88 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/android/tab_model/tab_model.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698