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

Unified Diff: chrome/browser/extensions/api/debugger/debugger_apitest.cc

Issue 1448903004: [DevTools] One infobar per extension. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nullptr Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/api/debugger/debugger_api.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/debugger/debugger_apitest.cc
diff --git a/chrome/browser/extensions/api/debugger/debugger_apitest.cc b/chrome/browser/extensions/api/debugger/debugger_apitest.cc
index 82c24e263b57a9289ed297c2e2550a13ba7701f2..1ca4e71fd3f4d8c20240409c70339d1b351a4821 100644
--- a/chrome/browser/extensions/api/debugger/debugger_apitest.cc
+++ b/chrome/browser/extensions/api/debugger/debugger_apitest.cc
@@ -193,6 +193,8 @@ IN_PROC_BROWSER_TEST_F(DebuggerApiTest, InfoBar) {
new Browser(Browser::CreateParams(profile(), chrome::GetActiveDesktop()));
AddBlankTabAndShow(another_browser);
AddBlankTabAndShow(another_browser);
+ int tab_id2 = SessionTabHelper::IdForTab(
+ another_browser->tab_strip_model()->GetActiveWebContents());
InfoBarService* service1 = InfoBarService::FromWebContents(
browser()->tab_strip_model()->GetActiveWebContents());
@@ -212,6 +214,27 @@ IN_PROC_BROWSER_TEST_F(DebuggerApiTest, InfoBar) {
EXPECT_EQ(1u, service2->infobar_count());
EXPECT_EQ(1u, service3->infobar_count());
+ // Second attach should not create infobars.
+ attach_function = new DebuggerAttachFunction();
+ attach_function->set_extension(extension());
+ ASSERT_TRUE(
+ RunFunction(attach_function.get(),
+ base::StringPrintf("[{\"tabId\": %d}, \"1.1\"]", tab_id2),
+ browser(), extension_function_test_utils::NONE));
+ EXPECT_EQ(1u, service1->infobar_count());
+ EXPECT_EQ(1u, service2->infobar_count());
+ EXPECT_EQ(1u, service3->infobar_count());
+
+ // Detach from one of the tabs should not remove infobars.
+ detach_function = new DebuggerDetachFunction();
+ detach_function->set_extension(extension());
+ ASSERT_TRUE(RunFunction(detach_function.get(),
+ base::StringPrintf("[{\"tabId\": %d}]", tab_id2),
+ browser(), extension_function_test_utils::NONE));
+ EXPECT_EQ(1u, service1->infobar_count());
+ EXPECT_EQ(1u, service2->infobar_count());
+ EXPECT_EQ(1u, service3->infobar_count());
+
// Detach should remove all infobars.
detach_function = new DebuggerDetachFunction();
detach_function->set_extension(extension());
« no previous file with comments | « chrome/browser/extensions/api/debugger/debugger_api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698