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/tabs/tab_strip_model.h" | 5 #include "chrome/browser/tabs/tab_strip_model.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 } | 133 } |
134 | 134 |
135 TabContentsWrapper* CreateTabContents() { | 135 TabContentsWrapper* CreateTabContents() { |
136 return Browser::TabContentsFactory( | 136 return Browser::TabContentsFactory( |
137 profile(), NULL, MSG_ROUTING_NONE, NULL, NULL); | 137 profile(), NULL, MSG_ROUTING_NONE, NULL, NULL); |
138 } | 138 } |
139 | 139 |
140 TabContentsWrapper* CreateTabContentsWithSharedRPH( | 140 TabContentsWrapper* CreateTabContentsWithSharedRPH( |
141 WebContents* web_contents) { | 141 WebContents* web_contents) { |
142 TabContentsWrapper* retval = Browser::TabContentsFactory(profile(), | 142 TabContentsWrapper* retval = Browser::TabContentsFactory(profile(), |
143 web_contents->GetRenderViewHost()->site_instance(), MSG_ROUTING_NONE, | 143 web_contents->GetRenderViewHost()->GetSiteInstance(), MSG_ROUTING_NONE, |
144 NULL, NULL); | 144 NULL, NULL); |
145 EXPECT_EQ(retval->web_contents()->GetRenderProcessHost(), | 145 EXPECT_EQ(retval->web_contents()->GetRenderProcessHost(), |
146 web_contents->GetRenderProcessHost()); | 146 web_contents->GetRenderProcessHost()); |
147 return retval; | 147 return retval; |
148 } | 148 } |
149 | 149 |
150 // Forwards a URL "load" request through to our dummy TabContents | 150 // Forwards a URL "load" request through to our dummy TabContents |
151 // implementation. | 151 // implementation. |
152 void LoadURL(WebContents* con, const std::wstring& url) { | 152 void LoadURL(WebContents* con, const std::wstring& url) { |
153 controller().LoadURL(GURL(WideToUTF16(url)), content::Referrer(), | 153 controller().LoadURL(GURL(WideToUTF16(url)), content::Referrer(), |
(...skipping 2226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2380 ASSERT_EQ(1, observer.GetStateCount()); | 2380 ASSERT_EQ(1, observer.GetStateCount()); |
2381 MockTabStripModelObserver::State s( | 2381 MockTabStripModelObserver::State s( |
2382 contents2, 1, MockTabStripModelObserver::SELECT); | 2382 contents2, 1, MockTabStripModelObserver::SELECT); |
2383 s.src_contents = contents2; | 2383 s.src_contents = contents2; |
2384 s.src_index = 1; | 2384 s.src_index = 1; |
2385 s.user_gesture = false; | 2385 s.user_gesture = false; |
2386 EXPECT_TRUE(observer.StateEquals(0, s)); | 2386 EXPECT_TRUE(observer.StateEquals(0, s)); |
2387 strip.RemoveObserver(&observer); | 2387 strip.RemoveObserver(&observer); |
2388 strip.CloseAllTabs(); | 2388 strip.CloseAllTabs(); |
2389 } | 2389 } |
OLD | NEW |