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 <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 command_line()->AppendSwitch(switches::kExtensionsOnChromeURLs); | 188 command_line()->AppendSwitch(switches::kExtensionsOnChromeURLs); |
189 EXPECT_TRUE(RunAttachFunction(other_ext_url, std::string())); | 189 EXPECT_TRUE(RunAttachFunction(other_ext_url, std::string())); |
190 } | 190 } |
191 | 191 |
192 IN_PROC_BROWSER_TEST_F(DebuggerApiTest, InfoBar) { | 192 IN_PROC_BROWSER_TEST_F(DebuggerApiTest, InfoBar) { |
193 int tab_id = SessionTabHelper::IdForTab( | 193 int tab_id = SessionTabHelper::IdForTab( |
194 browser()->tab_strip_model()->GetActiveWebContents()); | 194 browser()->tab_strip_model()->GetActiveWebContents()); |
195 scoped_refptr<DebuggerAttachFunction> attach_function; | 195 scoped_refptr<DebuggerAttachFunction> attach_function; |
196 scoped_refptr<DebuggerDetachFunction> detach_function; | 196 scoped_refptr<DebuggerDetachFunction> detach_function; |
197 | 197 |
198 Browser* another_browser = new Browser(Browser::CreateParams(profile())); | 198 Browser* another_browser = |
| 199 new Browser(Browser::CreateParams(profile(), true)); |
199 AddBlankTabAndShow(another_browser); | 200 AddBlankTabAndShow(another_browser); |
200 AddBlankTabAndShow(another_browser); | 201 AddBlankTabAndShow(another_browser); |
201 int tab_id2 = SessionTabHelper::IdForTab( | 202 int tab_id2 = SessionTabHelper::IdForTab( |
202 another_browser->tab_strip_model()->GetActiveWebContents()); | 203 another_browser->tab_strip_model()->GetActiveWebContents()); |
203 | 204 |
204 InfoBarService* service1 = InfoBarService::FromWebContents( | 205 InfoBarService* service1 = InfoBarService::FromWebContents( |
205 browser()->tab_strip_model()->GetActiveWebContents()); | 206 browser()->tab_strip_model()->GetActiveWebContents()); |
206 InfoBarService* service2 = InfoBarService::FromWebContents( | 207 InfoBarService* service2 = InfoBarService::FromWebContents( |
207 another_browser->tab_strip_model()->GetWebContentsAt(0)); | 208 another_browser->tab_strip_model()->GetWebContentsAt(0)); |
208 InfoBarService* service3 = InfoBarService::FromWebContents( | 209 InfoBarService* service3 = InfoBarService::FromWebContents( |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 // Detach should remove the remaining infobar. | 300 // Detach should remove the remaining infobar. |
300 detach_function = new DebuggerDetachFunction(); | 301 detach_function = new DebuggerDetachFunction(); |
301 detach_function->set_extension(extension()); | 302 detach_function->set_extension(extension()); |
302 ASSERT_TRUE(RunFunction(detach_function.get(), | 303 ASSERT_TRUE(RunFunction(detach_function.get(), |
303 base::StringPrintf("[{\"tabId\": %d}]", tab_id), | 304 base::StringPrintf("[{\"tabId\": %d}]", tab_id), |
304 browser(), extension_function_test_utils::NONE)); | 305 browser(), extension_function_test_utils::NONE)); |
305 EXPECT_EQ(0u, service1->infobar_count()); | 306 EXPECT_EQ(0u, service1->infobar_count()); |
306 } | 307 } |
307 | 308 |
308 } // namespace extensions | 309 } // namespace extensions |
OLD | NEW |