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