| Index: chrome/browser/ssl/captive_portal_blocking_page_browsertest.cc
|
| diff --git a/chrome/browser/ssl/captive_portal_blocking_page_browsertest.cc b/chrome/browser/ssl/captive_portal_blocking_page_browsertest.cc
|
| index ec7402c4aab6ec90f242dfee36ab86105715f7cd..9be2ce7bf98fc27acb57c786bdf9b50c40d58266 100644
|
| --- a/chrome/browser/ssl/captive_portal_blocking_page_browsertest.cc
|
| +++ b/chrome/browser/ssl/captive_portal_blocking_page_browsertest.cc
|
| @@ -11,6 +11,7 @@
|
| #include "base/macros.h"
|
| #include "base/prefs/pref_service.h"
|
| #include "base/strings/stringprintf.h"
|
| +#include "chrome/browser/interstitials/security_interstitial_page_test_utils.h"
|
| #include "chrome/browser/profiles/profile.h"
|
| #include "chrome/browser/ui/browser.h"
|
| #include "chrome/browser/ui/tabs/tab_strip_model.h"
|
| @@ -23,6 +24,8 @@
|
| #include "testing/gtest/include/gtest/gtest.h"
|
| #include "url/gurl.h"
|
|
|
| +using chrome_browser_interstitials::IsInterstitialDisplayingText;
|
| +
|
| namespace {
|
| // Partial text in the captive portal interstitial's main paragraph when the
|
| // login domain isn't displayed.
|
| @@ -30,23 +33,6 @@ const char kGenericLoginURLText[] = "its login page";
|
| const char kBrokenSSL[] = "https://broken.ssl";
|
| const char kWiFiSSID[] = "WiFiSSID";
|
|
|
| -// Returns true if the interstitial contains |text| in its body.
|
| -bool IsInterstitialDisplayingText(content::InterstitialPage* interstitial,
|
| - const std::string& text) {
|
| - // It's valid for |text| to contain "\'", but simply look for "'" instead
|
| - // since this function is used for searching host names and a predefined
|
| - // string.
|
| - DCHECK(text.find("\'") == std::string::npos);
|
| - std::string command = base::StringPrintf(
|
| - "var hasText = document.body.textContent.indexOf('%s') >= 0;"
|
| - "window.domAutomationController.send(hasText ? 1 : 0);",
|
| - text.c_str());
|
| - int result = 0;
|
| - EXPECT_TRUE(content::ExecuteScriptAndExtractInt(
|
| - interstitial->GetMainFrame(), command, &result));
|
| - return result == 1;
|
| -}
|
| -
|
| enum ExpectWiFi {
|
| EXPECT_WIFI_NO,
|
| EXPECT_WIFI_YES
|
|
|