Remove NOTIFICATION_WEB_CONTENT_SETTINGS_CHANGED
In production, this had only one listener (LocationBar) but many
callsites. Update callsites to more directly access LocationBar.
In tests, replace by listening for visibility changes in the relevant
location bar icon.
Bug: 268984
Change-Id: I552c9ea27d606e992c099b63d14ca123820658b6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1682795
Reviewed-by: Scott Violet <[email protected]>
Commit-Queue: Evan Stade <[email protected]>
Cr-Commit-Position: refs/heads/master@{#675288}
diff --git a/chrome/browser/extensions/app_process_apitest.cc b/chrome/browser/extensions/app_process_apitest.cc
index fd1b73d..242b95c 100644
--- a/chrome/browser/extensions/app_process_apitest.cc
+++ b/chrome/browser/extensions/app_process_apitest.cc
@@ -16,7 +16,9 @@
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
+#include "chrome/browser/ui/view_ids.h"
#include "chrome/common/chrome_switches.h"
+#include "chrome/test/base/interactive_test_utils.h"
#include "chrome/test/base/ui_test_utils.h"
#include "components/sync/model/string_ordinal.h"
#include "content/public/browser/navigation_entry.h"
@@ -643,17 +645,12 @@
ui_test_utils::NavigateToURL(
browser(), GetTestBaseURL("app_process").Resolve("path3/container.html"));
+ ui_test_utils::WaitForViewVisibility(browser(), VIEW_ID_CONTENT_SETTING_POPUP,
+ true);
WebContents* tab = browser()->tab_strip_model()->GetActiveWebContents();
PopupBlockerTabHelper* popup_blocker_tab_helper =
PopupBlockerTabHelper::FromWebContents(tab);
- if (!popup_blocker_tab_helper->GetBlockedPopupsCount()) {
- content::WindowedNotificationObserver observer(
- chrome::NOTIFICATION_WEB_CONTENT_SETTINGS_CHANGED,
- content::NotificationService::AllSources());
- observer.Wait();
- }
-
EXPECT_EQ(1u, popup_blocker_tab_helper->GetBlockedPopupsCount());
}