Refactor dialog testing framework to allow arbitrary UI testing.

This introduces a new base class, TestBrowserUI, and reorganizes the existing
test code into a series of virtual functions so tests can provide the necessary
implementation for non-dialog cases.

This also adds a single consumer of this new base class, InfoBarUITest, to
verify it works.

Bug: 686285
Change-Id: I2b5a7c86347f5042ac5218c9fa90e94f68adf577
Reviewed-on: https://chromium-review.googlesource.com/804953
Commit-Queue: Peter Kasting <[email protected]>
Reviewed-by: Scott Violet <[email protected]>
Reviewed-by: Trent Apted <[email protected]>
Cr-Commit-Position: refs/heads/master@{#524855}
diff --git a/chrome/browser/ui/collected_cookies_browsertest.cc b/chrome/browser/ui/collected_cookies_browsertest.cc
index 2d79848..66e801f 100644
--- a/chrome/browser/ui/collected_cookies_browsertest.cc
+++ b/chrome/browser/ui/collected_cookies_browsertest.cc
@@ -24,7 +24,7 @@
   CollectedCookiesTest() {}
 
   // DialogBrowserTest:
-  void ShowDialog(const std::string& name) override {
+  void ShowUi(const std::string& name) override {
     ASSERT_TRUE(embedded_test_server()->Start());
 
     // Disable cookies.
@@ -62,16 +62,14 @@
   DISALLOW_COPY_AND_ASSIGN(CollectedCookiesTestMd);
 };
 
-// Test that calls ShowDialog("default"). Interactive when run via
-// browser_tests --gtest_filter=BrowserDialogTest.Invoke --interactive
-// --dialog=CollectedCookiesTestMd.InvokeDialog_default
-IN_PROC_BROWSER_TEST_F(CollectedCookiesTestMd, InvokeDialog_default) {
-  RunDialog();
+// Test that calls ShowUi("default").
+IN_PROC_BROWSER_TEST_F(CollectedCookiesTestMd, InvokeUi_default) {
+  ShowAndVerifyUi();
 }
 
 // If this crashes on Windows, use http://crbug.com/79331
 IN_PROC_BROWSER_TEST_F(CollectedCookiesTest, DoubleDisplay) {
-  ShowDialog(std::string());
+  ShowUi(std::string());
 
   // Click on the info link a second time.
   content::WebContents* web_contents =
@@ -81,7 +79,7 @@
 
 // If this crashes on Windows, use http://crbug.com/79331
 IN_PROC_BROWSER_TEST_F(CollectedCookiesTest, NavigateAway) {
-  ShowDialog(std::string());
+  ShowUi(std::string());
 
   // Navigate to another page.
   ui_test_utils::NavigateToURL(