summaryrefslogtreecommitdiffstats
path: root/components
diff options
context:
space:
mode:
authorthestig <thestig@chromium.org>2015-08-18 13:36:39 -0700
committerCommit bot <commit-bot@chromium.org>2015-08-18 20:37:13 +0000
commit4b0b01655f3ea1f022c042c243bc13ddc6d34326 (patch)
treebb303de61bc1cd891a71638f92f223cf718a561a /components
parent617b6884df16e7d96a6cb065af6967a69411757e (diff)
downloadchromium_src-4b0b01655f3ea1f022c042c243bc13ddc6d34326.zip
chromium_src-4b0b01655f3ea1f022c042c243bc13ddc6d34326.tar.gz
chromium_src-4b0b01655f3ea1f022c042c243bc13ddc6d34326.tar.bz2
Put components/error_page code in namespace error_page.
Review URL: https://codereview.chromium.org/1301733002 Cr-Commit-Position: refs/heads/master@{#344019}
Diffstat (limited to 'components')
-rw-r--r--components/error_page/common/net_error_info.cc23
-rw-r--r--components/error_page/common/net_error_info.h11
-rw-r--r--components/error_page/renderer/net_error_helper_core.cc62
-rw-r--r--components/error_page/renderer/net_error_helper_core.h6
-rw-r--r--components/error_page/renderer/net_error_helper_core_unittest.cc666
5 files changed, 363 insertions, 405 deletions
diff --git a/components/error_page/common/net_error_info.cc b/components/error_page/common/net_error_info.cc
index 0fd913b..1ac7264 100644
--- a/components/error_page/common/net_error_info.cc
+++ b/components/error_page/common/net_error_info.cc
@@ -13,19 +13,19 @@ const char kDnsProbeErrorDomain[] = "dnsprobe";
const char* DnsProbeStatusToString(int status) {
switch (status) {
- case chrome_common_net::DNS_PROBE_POSSIBLE:
+ case DNS_PROBE_POSSIBLE:
return "DNS_PROBE_POSSIBLE";
- case chrome_common_net::DNS_PROBE_NOT_RUN:
+ case DNS_PROBE_NOT_RUN:
return "DNS_PROBE_NOT_RUN";
- case chrome_common_net::DNS_PROBE_STARTED:
+ case DNS_PROBE_STARTED:
return "DNS_PROBE_STARTED";
- case chrome_common_net::DNS_PROBE_FINISHED_INCONCLUSIVE:
+ case DNS_PROBE_FINISHED_INCONCLUSIVE:
return "DNS_PROBE_FINISHED_INCONCLUSIVE";
- case chrome_common_net::DNS_PROBE_FINISHED_NO_INTERNET:
+ case DNS_PROBE_FINISHED_NO_INTERNET:
return "DNS_PROBE_FINISHED_NO_INTERNET";
- case chrome_common_net::DNS_PROBE_FINISHED_BAD_CONFIG:
+ case DNS_PROBE_FINISHED_BAD_CONFIG:
return "DNS_PROBE_FINISHED_BAD_CONFIG";
- case chrome_common_net::DNS_PROBE_FINISHED_NXDOMAIN:
+ case DNS_PROBE_FINISHED_NXDOMAIN:
return "DNS_PROBE_FINISHED_NXDOMAIN";
default:
NOTREACHED();
@@ -33,14 +33,13 @@ const char* DnsProbeStatusToString(int status) {
}
}
-bool DnsProbeStatusIsFinished(chrome_common_net::DnsProbeStatus status) {
- return status >= chrome_common_net::DNS_PROBE_FINISHED_INCONCLUSIVE &&
- status < chrome_common_net::DNS_PROBE_MAX;
+bool DnsProbeStatusIsFinished(DnsProbeStatus status) {
+ return status >= DNS_PROBE_FINISHED_INCONCLUSIVE && status < DNS_PROBE_MAX;
}
-void RecordEvent(chrome_common_net::NetworkErrorPageEvent event) {
+void RecordEvent(NetworkErrorPageEvent event) {
UMA_HISTOGRAM_ENUMERATION("Net.ErrorPageCounts", event,
- chrome_common_net::NETWORK_ERROR_PAGE_EVENT_MAX);
+ NETWORK_ERROR_PAGE_EVENT_MAX);
}
} // namespace error_page
diff --git a/components/error_page/common/net_error_info.h b/components/error_page/common/net_error_info.h
index 4ebd068..de0e8ec 100644
--- a/components/error_page/common/net_error_info.h
+++ b/components/error_page/common/net_error_info.h
@@ -5,8 +5,7 @@
#ifndef COMPONENTS_ERROR_PAGE_COMMON_NET_ERROR_INFO_H_
#define COMPONENTS_ERROR_PAGE_COMMON_NET_ERROR_INFO_H_
-// TODO(hashimoto): Change this to namespace error_page.
-namespace chrome_common_net {
+namespace error_page {
// Network error page events. Used for UMA statistics.
enum NetworkErrorPageEvent {
@@ -83,10 +82,6 @@ enum DnsProbeStatus {
DNS_PROBE_MAX
};
-} // namespace chrome_common_net
-
-namespace error_page {
-
// Returns a string representing |status|. It should be simply the name of
// the value as a string, but don't rely on that. This is presented to the
// user as part of the DNS error page (as the error code, at the bottom),
@@ -98,10 +93,10 @@ namespace error_page {
const char* DnsProbeStatusToString(int status);
// Returns true if |status| is one of the DNS_PROBE_FINISHED_* statuses.
-bool DnsProbeStatusIsFinished(chrome_common_net::DnsProbeStatus status);
+bool DnsProbeStatusIsFinished(DnsProbeStatus status);
// Record specific error page events.
-void RecordEvent(chrome_common_net::NetworkErrorPageEvent event);
+void RecordEvent(NetworkErrorPageEvent event);
// The error domain used to pass DNS probe statuses to the localized error
// code.
diff --git a/components/error_page/renderer/net_error_helper_core.cc b/components/error_page/renderer/net_error_helper_core.cc
index da61080..f97ba7d 100644
--- a/components/error_page/renderer/net_error_helper_core.cc
+++ b/components/error_page/renderer/net_error_helper_core.cc
@@ -470,7 +470,7 @@ NetErrorHelperCore::NetErrorHelperCore(Delegate* delegate,
bool auto_reload_visible_only,
bool is_visible)
: delegate_(delegate),
- last_probe_status_(chrome_common_net::DNS_PROBE_POSSIBLE),
+ last_probe_status_(DNS_PROBE_POSSIBLE),
can_show_network_diagnostics_dialog_(false),
auto_reload_enabled_(auto_reload_enabled),
auto_reload_visible_only_(auto_reload_visible_only),
@@ -571,8 +571,8 @@ void NetErrorHelperCore::OnCommitLoad(FrameType frame_type, const GURL& url) {
DCHECK(navigation_from_button_ == RELOAD_BUTTON ||
navigation_from_button_ == SHOW_SAVED_COPY_BUTTON);
RecordEvent(navigation_from_button_ == RELOAD_BUTTON ?
- chrome_common_net::NETWORK_ERROR_PAGE_RELOAD_BUTTON_ERROR :
- chrome_common_net::NETWORK_ERROR_PAGE_SHOW_SAVED_COPY_BUTTON_ERROR);
+ NETWORK_ERROR_PAGE_RELOAD_BUTTON_ERROR :
+ NETWORK_ERROR_PAGE_SHOW_SAVED_COPY_BUTTON_ERROR);
}
navigation_from_button_ = NO_BUTTON;
@@ -600,22 +600,21 @@ void NetErrorHelperCore::OnFinishLoad(FrameType frame_type) {
committed_error_page_info_->is_finished_loading = true;
- RecordEvent(chrome_common_net::NETWORK_ERROR_PAGE_SHOWN);
+ RecordEvent(NETWORK_ERROR_PAGE_SHOWN);
if (committed_error_page_info_->reload_button_in_page) {
- RecordEvent(chrome_common_net::NETWORK_ERROR_PAGE_RELOAD_BUTTON_SHOWN);
+ RecordEvent(NETWORK_ERROR_PAGE_RELOAD_BUTTON_SHOWN);
}
if (committed_error_page_info_->show_saved_copy_button_in_page) {
- RecordEvent(
- chrome_common_net::NETWORK_ERROR_PAGE_SHOW_SAVED_COPY_BUTTON_SHOWN);
+ RecordEvent(NETWORK_ERROR_PAGE_SHOW_SAVED_COPY_BUTTON_SHOWN);
}
if (committed_error_page_info_->reload_button_in_page &&
committed_error_page_info_->show_saved_copy_button_in_page) {
- RecordEvent(chrome_common_net::NETWORK_ERROR_PAGE_BOTH_BUTTONS_SHOWN);
+ RecordEvent(NETWORK_ERROR_PAGE_BOTH_BUTTONS_SHOWN);
}
if (committed_error_page_info_->show_cached_copy_button_in_page) {
- RecordEvent(chrome_common_net::NETWORK_ERROR_PAGE_CACHED_COPY_BUTTON_SHOWN);
+ RecordEvent(NETWORK_ERROR_PAGE_CACHED_COPY_BUTTON_SHOWN);
} else if (committed_error_page_info_->show_cached_page_button_in_page) {
- RecordEvent(chrome_common_net::NETWORK_ERROR_PAGE_CACHED_PAGE_BUTTON_SHOWN);
+ RecordEvent(NETWORK_ERROR_PAGE_CACHED_PAGE_BUTTON_SHOWN);
}
delegate_->EnablePageHelperFunctions();
@@ -636,7 +635,7 @@ void NetErrorHelperCore::OnFinishLoad(FrameType frame_type) {
}
if (!committed_error_page_info_->needs_dns_updates ||
- last_probe_status_ == chrome_common_net::DNS_PROBE_POSSIBLE) {
+ last_probe_status_ == DNS_PROBE_POSSIBLE) {
return;
}
DVLOG(1) << "Error page finished loading; sending saved status.";
@@ -674,9 +673,8 @@ void NetErrorHelperCore::GetErrorHTML(
}
}
-void NetErrorHelperCore::OnNetErrorInfo(
- chrome_common_net::DnsProbeStatus status) {
- DCHECK_NE(chrome_common_net::DNS_PROBE_POSSIBLE, status);
+void NetErrorHelperCore::OnNetErrorInfo(DnsProbeStatus status) {
+ DCHECK_NE(DNS_PROBE_POSSIBLE, status);
last_probe_status_ = status;
@@ -726,7 +724,7 @@ void NetErrorHelperCore::GetErrorHtmlForMainFrame(
// loading, a DNS probe status scheduled to be sent to it may be thrown
// out, but since the new error page should trigger a new DNS probe, it
// will just get the results for the next page load.
- last_probe_status_ = chrome_common_net::DNS_PROBE_POSSIBLE;
+ last_probe_status_ = DNS_PROBE_POSSIBLE;
pending_error_page_info->needs_dns_updates = true;
error = GetUpdatedError(error);
}
@@ -745,15 +743,15 @@ void NetErrorHelperCore::GetErrorHtmlForMainFrame(
void NetErrorHelperCore::UpdateErrorPage() {
DCHECK(committed_error_page_info_->needs_dns_updates);
DCHECK(committed_error_page_info_->is_finished_loading);
- DCHECK_NE(chrome_common_net::DNS_PROBE_POSSIBLE, last_probe_status_);
+ DCHECK_NE(DNS_PROBE_POSSIBLE, last_probe_status_);
UMA_HISTOGRAM_ENUMERATION("DnsProbe.ErrorPageUpdateStatus",
last_probe_status_,
- chrome_common_net::DNS_PROBE_MAX);
+ DNS_PROBE_MAX);
// Every status other than DNS_PROBE_POSSIBLE and DNS_PROBE_STARTED is a
// final status code. Once one is reached, the page does not need further
// updates.
- if (last_probe_status_ != chrome_common_net::DNS_PROBE_STARTED)
+ if (last_probe_status_ != DNS_PROBE_STARTED)
committed_error_page_info_->needs_dns_updates = false;
// There is no need to worry about the button display statistics here because
@@ -822,9 +820,8 @@ void NetErrorHelperCore::OnNavigationCorrectionsFetched(
blink::WebURLError NetErrorHelperCore::GetUpdatedError(
const blink::WebURLError& error) const {
// If a probe didn't run or wasn't conclusive, restore the original error.
- if (last_probe_status_ == chrome_common_net::DNS_PROBE_NOT_RUN ||
- last_probe_status_ ==
- chrome_common_net::DNS_PROBE_FINISHED_INCONCLUSIVE) {
+ if (last_probe_status_ == DNS_PROBE_NOT_RUN ||
+ last_probe_status_ == DNS_PROBE_FINISHED_INCONCLUSIVE) {
return error;
}
@@ -957,42 +954,37 @@ void NetErrorHelperCore::ExecuteButtonPress(bool is_error_page, Button button) {
switch (button) {
case RELOAD_BUTTON:
- RecordEvent(chrome_common_net::NETWORK_ERROR_PAGE_RELOAD_BUTTON_CLICKED);
+ RecordEvent(NETWORK_ERROR_PAGE_RELOAD_BUTTON_CLICKED);
if (committed_error_page_info_->show_saved_copy_button_in_page) {
- RecordEvent(
- chrome_common_net::NETWORK_ERROR_PAGE_BOTH_BUTTONS_RELOAD_CLICKED);
+ RecordEvent(NETWORK_ERROR_PAGE_BOTH_BUTTONS_RELOAD_CLICKED);
}
navigation_from_button_ = RELOAD_BUTTON;
Reload();
return;
case SHOW_SAVED_COPY_BUTTON:
- RecordEvent(
- chrome_common_net::NETWORK_ERROR_PAGE_SHOW_SAVED_COPY_BUTTON_CLICKED);
+ RecordEvent(NETWORK_ERROR_PAGE_SHOW_SAVED_COPY_BUTTON_CLICKED);
navigation_from_button_ = SHOW_SAVED_COPY_BUTTON;
if (committed_error_page_info_->reload_button_in_page) {
- RecordEvent(chrome_common_net::
- NETWORK_ERROR_PAGE_BOTH_BUTTONS_SHOWN_SAVED_COPY_CLICKED);
+ RecordEvent(NETWORK_ERROR_PAGE_BOTH_BUTTONS_SHOWN_SAVED_COPY_CLICKED);
}
delegate_->LoadPageFromCache(
committed_error_page_info_->error.unreachableURL);
return;
case MORE_BUTTON:
// Visual effects on page are handled in Javascript code.
- RecordEvent(chrome_common_net::NETWORK_ERROR_PAGE_MORE_BUTTON_CLICKED);
+ RecordEvent(NETWORK_ERROR_PAGE_MORE_BUTTON_CLICKED);
return;
case EASTER_EGG:
- RecordEvent(chrome_common_net::NETWORK_ERROR_EASTER_EGG_ACTIVATED);
+ RecordEvent(NETWORK_ERROR_EASTER_EGG_ACTIVATED);
return;
case SHOW_CACHED_COPY_BUTTON:
- RecordEvent(
- chrome_common_net::NETWORK_ERROR_PAGE_CACHED_COPY_BUTTON_CLICKED);
+ RecordEvent(NETWORK_ERROR_PAGE_CACHED_COPY_BUTTON_CLICKED);
return;
case SHOW_CACHED_PAGE_BUTTON:
- RecordEvent(
- chrome_common_net::NETWORK_ERROR_PAGE_CACHED_PAGE_BUTTON_CLICKED);
+ RecordEvent(NETWORK_ERROR_PAGE_CACHED_PAGE_BUTTON_CLICKED);
return;
case DIAGNOSE_ERROR:
- RecordEvent(chrome_common_net::NETWORK_ERROR_DIAGNOSE_BUTTON_CLICKED);
+ RecordEvent(NETWORK_ERROR_DIAGNOSE_BUTTON_CLICKED);
delegate_->DiagnoseError(
committed_error_page_info_->error.unreachableURL);
return;
diff --git a/components/error_page/renderer/net_error_helper_core.h b/components/error_page/renderer/net_error_helper_core.h
index 8183d5f..98ee6ef 100644
--- a/components/error_page/renderer/net_error_helper_core.h
+++ b/components/error_page/renderer/net_error_helper_core.h
@@ -63,7 +63,7 @@ class NetErrorHelperCore {
const blink::WebURLError& error,
bool is_failed_post,
bool can_show_network_diagnostics_dialog,
- scoped_ptr<error_page::ErrorPageParams> params,
+ scoped_ptr<ErrorPageParams> params,
bool* reload_button_shown,
bool* show_saved_copy_button_shown,
bool* show_cached_copy_button_shown,
@@ -165,7 +165,7 @@ class NetErrorHelperCore {
// Notifies |this| that network error information from the browser process
// has been received.
- void OnNetErrorInfo(chrome_common_net::DnsProbeStatus status);
+ void OnNetErrorInfo(DnsProbeStatus status);
// Notifies |this| if it can use a local error diagnostics service through its
// delegate.
@@ -240,7 +240,7 @@ class NetErrorHelperCore {
Delegate* delegate_;
// The last DnsProbeStatus received from the browser.
- chrome_common_net::DnsProbeStatus last_probe_status_;
+ DnsProbeStatus last_probe_status_;
// Information for the provisional / "pre-provisional" error page. NULL when
// there's no page pending, or the pending page is not an error page.
diff --git a/components/error_page/renderer/net_error_helper_core_unittest.cc b/components/error_page/renderer/net_error_helper_core_unittest.cc
index 4721f63..1303075 100644
--- a/components/error_page/renderer/net_error_helper_core_unittest.cc
+++ b/components/error_page/renderer/net_error_helper_core_unittest.cc
@@ -29,7 +29,6 @@ namespace error_page {
namespace {
using blink::WebURLError;
-using chrome_common_net::DnsProbeStatus;
const char kFailedUrl[] = "http://failed/";
const char kFailedHttpsUrl[] = "https://failed/";
@@ -261,17 +260,17 @@ class NetErrorHelperCoreTest : public testing::Test,
void DoErrorLoadOfURL(net::Error error, const GURL& url) {
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::NON_ERROR_PAGE);
+ NetErrorHelperCore::NON_ERROR_PAGE);
std::string html;
core()->GetErrorHTML(NetErrorHelperCore::MAIN_FRAME,
- NetErrorForURL(error, url), false, &html);
+ NetErrorForURL(error, url), false, &html);
EXPECT_FALSE(html.empty());
EXPECT_EQ(NetErrorStringForURL(error, url), html);
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::ERROR_PAGE);
+ NetErrorHelperCore::ERROR_PAGE);
core()->OnCommitLoad(NetErrorHelperCore::MAIN_FRAME,
- error_url());
+ error_url());
core()->OnFinishLoad(NetErrorHelperCore::MAIN_FRAME);
}
@@ -281,13 +280,13 @@ class NetErrorHelperCoreTest : public testing::Test,
void DoSuccessLoad() {
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::NON_ERROR_PAGE);
+ NetErrorHelperCore::NON_ERROR_PAGE);
core()->OnCommitLoad(NetErrorHelperCore::MAIN_FRAME, default_url());
core()->OnFinishLoad(NetErrorHelperCore::MAIN_FRAME);
}
- void DoDnsProbe(chrome_common_net::DnsProbeStatus final_status) {
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_STARTED);
+ void DoDnsProbe(DnsProbeStatus final_status) {
+ core()->OnNetErrorInfo(DNS_PROBE_STARTED);
core()->OnNetErrorInfo(final_status);
}
@@ -311,8 +310,8 @@ class NetErrorHelperCoreTest : public testing::Test,
private:
void SetNavigationCorrectionURL(const GURL& navigation_correction_url) {
core()->OnSetNavigationCorrectionInfo(navigation_correction_url,
- kLanguage, kCountry, kApiKey,
- GURL(kSearchUrl));
+ kLanguage, kCountry, kApiKey,
+ GURL(kSearchUrl));
}
// NetErrorHelperCore::Delegate implementation:
@@ -467,7 +466,7 @@ TEST_F(NetErrorHelperCoreTest, Null) {
TEST_F(NetErrorHelperCoreTest, SuccessfulPageLoad) {
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::NON_ERROR_PAGE);
+ NetErrorHelperCore::NON_ERROR_PAGE);
core()->OnCommitLoad(NetErrorHelperCore::MAIN_FRAME, default_url());
core()->OnFinishLoad(NetErrorHelperCore::MAIN_FRAME);
EXPECT_EQ(0, update_count());
@@ -477,7 +476,7 @@ TEST_F(NetErrorHelperCoreTest, SuccessfulPageLoad) {
TEST_F(NetErrorHelperCoreTest, SuccessfulPageLoadWithNavigationCorrections) {
EnableNavigationCorrections();
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::NON_ERROR_PAGE);
+ NetErrorHelperCore::NON_ERROR_PAGE);
core()->OnCommitLoad(NetErrorHelperCore::MAIN_FRAME, default_url());
core()->OnFinishLoad(NetErrorHelperCore::MAIN_FRAME);
EXPECT_EQ(0, update_count());
@@ -487,12 +486,12 @@ TEST_F(NetErrorHelperCoreTest, SuccessfulPageLoadWithNavigationCorrections) {
TEST_F(NetErrorHelperCoreTest, MainFrameNonDnsError) {
// Original page starts loading.
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::NON_ERROR_PAGE);
+ NetErrorHelperCore::NON_ERROR_PAGE);
// It fails, and an error page is requested.
std::string html;
core()->GetErrorHTML(NetErrorHelperCore::MAIN_FRAME,
- NetError(net::ERR_CONNECTION_RESET), false, &html);
+ NetError(net::ERR_CONNECTION_RESET), false, &html);
// Should have returned a local error page.
EXPECT_FALSE(html.empty());
EXPECT_EQ(NetErrorString(net::ERR_CONNECTION_RESET), html);
@@ -500,7 +499,7 @@ TEST_F(NetErrorHelperCoreTest, MainFrameNonDnsError) {
// Error page loads.
EXPECT_EQ(0, enable_page_helper_functions_count());
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::ERROR_PAGE);
+ NetErrorHelperCore::ERROR_PAGE);
core()->OnCommitLoad(NetErrorHelperCore::MAIN_FRAME, error_url());
core()->OnFinishLoad(NetErrorHelperCore::MAIN_FRAME);
EXPECT_EQ(0, update_count());
@@ -513,19 +512,19 @@ TEST_F(NetErrorHelperCoreTest, MainFrameNonDnsErrorWithCorrections) {
// Original page starts loading.
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::NON_ERROR_PAGE);
+ NetErrorHelperCore::NON_ERROR_PAGE);
// It fails, and an error page is requested.
std::string html;
core()->GetErrorHTML(NetErrorHelperCore::MAIN_FRAME,
- NetError(net::ERR_CONNECTION_RESET), false, &html);
+ NetError(net::ERR_CONNECTION_RESET), false, &html);
// Should have returned a local error page.
EXPECT_FALSE(html.empty());
EXPECT_EQ(NetErrorString(net::ERR_CONNECTION_RESET), html);
// Error page loads.
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::ERROR_PAGE);
+ NetErrorHelperCore::ERROR_PAGE);
core()->OnCommitLoad(NetErrorHelperCore::MAIN_FRAME, error_url());
core()->OnFinishLoad(NetErrorHelperCore::MAIN_FRAME);
EXPECT_EQ(0, update_count());
@@ -537,15 +536,15 @@ TEST_F(NetErrorHelperCoreTest, MainFrameNonDnsErrorWithCorrections) {
TEST_F(NetErrorHelperCoreTest, MainFrameNonDnsErrorSpuriousStatus) {
// Original page starts loading.
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::NON_ERROR_PAGE);
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_FINISHED_NXDOMAIN);
+ NetErrorHelperCore::NON_ERROR_PAGE);
+ core()->OnNetErrorInfo(DNS_PROBE_FINISHED_NXDOMAIN);
// It fails, and an error page is requested.
std::string html;
core()->GetErrorHTML(NetErrorHelperCore::MAIN_FRAME,
- NetError(net::ERR_CONNECTION_RESET),
- false, &html);
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_FINISHED_NXDOMAIN);
+ NetError(net::ERR_CONNECTION_RESET),
+ false, &html);
+ core()->OnNetErrorInfo(DNS_PROBE_FINISHED_NXDOMAIN);
// Should have returned a local error page.
EXPECT_FALSE(html.empty());
@@ -554,14 +553,14 @@ TEST_F(NetErrorHelperCoreTest, MainFrameNonDnsErrorSpuriousStatus) {
// Error page loads.
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::ERROR_PAGE);
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_FINISHED_NXDOMAIN);
+ NetErrorHelperCore::ERROR_PAGE);
+ core()->OnNetErrorInfo(DNS_PROBE_FINISHED_NXDOMAIN);
core()->OnCommitLoad(NetErrorHelperCore::MAIN_FRAME, error_url());
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_FINISHED_NXDOMAIN);
+ core()->OnNetErrorInfo(DNS_PROBE_FINISHED_NXDOMAIN);
core()->OnFinishLoad(NetErrorHelperCore::MAIN_FRAME);
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_FINISHED_NXDOMAIN);
+ core()->OnNetErrorInfo(DNS_PROBE_FINISHED_NXDOMAIN);
EXPECT_EQ(0, update_count());
EXPECT_EQ(0, error_html_update_count());
@@ -570,19 +569,19 @@ TEST_F(NetErrorHelperCoreTest, MainFrameNonDnsErrorSpuriousStatus) {
TEST_F(NetErrorHelperCoreTest, SubFrameDnsError) {
// Original page starts loading.
core()->OnStartLoad(NetErrorHelperCore::SUB_FRAME,
- NetErrorHelperCore::NON_ERROR_PAGE);
+ NetErrorHelperCore::NON_ERROR_PAGE);
// It fails, and an error page is requested.
std::string html;
core()->GetErrorHTML(NetErrorHelperCore::SUB_FRAME,
- NetError(net::ERR_NAME_NOT_RESOLVED),
- false, &html);
+ NetError(net::ERR_NAME_NOT_RESOLVED),
+ false, &html);
// Should have returned a local error page.
EXPECT_EQ(NetErrorString(net::ERR_NAME_NOT_RESOLVED), html);
// Error page loads.
core()->OnStartLoad(NetErrorHelperCore::SUB_FRAME,
- NetErrorHelperCore::ERROR_PAGE);
+ NetErrorHelperCore::ERROR_PAGE);
core()->OnCommitLoad(NetErrorHelperCore::SUB_FRAME, error_url());
core()->OnFinishLoad(NetErrorHelperCore::SUB_FRAME);
EXPECT_EQ(0, update_count());
@@ -594,19 +593,19 @@ TEST_F(NetErrorHelperCoreTest, SubFrameDnsErrorWithCorrections) {
// Original page starts loading.
core()->OnStartLoad(NetErrorHelperCore::SUB_FRAME,
- NetErrorHelperCore::NON_ERROR_PAGE);
+ NetErrorHelperCore::NON_ERROR_PAGE);
// It fails, and an error page is requested.
std::string html;
core()->GetErrorHTML(NetErrorHelperCore::SUB_FRAME,
- NetError(net::ERR_NAME_NOT_RESOLVED),
- false, &html);
+ NetError(net::ERR_NAME_NOT_RESOLVED),
+ false, &html);
// Should have returned a local error page.
EXPECT_EQ(NetErrorString(net::ERR_NAME_NOT_RESOLVED), html);
// Error page loads.
core()->OnStartLoad(NetErrorHelperCore::SUB_FRAME,
- NetErrorHelperCore::ERROR_PAGE);
+ NetErrorHelperCore::ERROR_PAGE);
core()->OnCommitLoad(NetErrorHelperCore::SUB_FRAME, error_url());
core()->OnFinishLoad(NetErrorHelperCore::SUB_FRAME);
EXPECT_EQ(0, update_count());
@@ -618,15 +617,15 @@ TEST_F(NetErrorHelperCoreTest, SubFrameDnsErrorWithCorrections) {
TEST_F(NetErrorHelperCoreTest, SubFrameDnsErrorSpuriousStatus) {
// Original page starts loading.
core()->OnStartLoad(NetErrorHelperCore::SUB_FRAME,
- NetErrorHelperCore::NON_ERROR_PAGE);
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_FINISHED_NXDOMAIN);
+ NetErrorHelperCore::NON_ERROR_PAGE);
+ core()->OnNetErrorInfo(DNS_PROBE_FINISHED_NXDOMAIN);
// It fails, and an error page is requested.
std::string html;
core()->GetErrorHTML(NetErrorHelperCore::SUB_FRAME,
- NetError(net::ERR_NAME_NOT_RESOLVED),
- false, &html);
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_FINISHED_NXDOMAIN);
+ NetError(net::ERR_NAME_NOT_RESOLVED),
+ false, &html);
+ core()->OnNetErrorInfo(DNS_PROBE_FINISHED_NXDOMAIN);
// Should have returned a local error page.
EXPECT_EQ(NetErrorString(net::ERR_NAME_NOT_RESOLVED), html);
@@ -634,14 +633,14 @@ TEST_F(NetErrorHelperCoreTest, SubFrameDnsErrorSpuriousStatus) {
// Error page loads.
core()->OnStartLoad(NetErrorHelperCore::SUB_FRAME,
- NetErrorHelperCore::ERROR_PAGE);
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_FINISHED_NXDOMAIN);
+ NetErrorHelperCore::ERROR_PAGE);
+ core()->OnNetErrorInfo(DNS_PROBE_FINISHED_NXDOMAIN);
core()->OnCommitLoad(NetErrorHelperCore::SUB_FRAME, error_url());
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_FINISHED_NXDOMAIN);
+ core()->OnNetErrorInfo(DNS_PROBE_FINISHED_NXDOMAIN);
core()->OnFinishLoad(NetErrorHelperCore::SUB_FRAME);
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_FINISHED_NXDOMAIN);
+ core()->OnNetErrorInfo(DNS_PROBE_FINISHED_NXDOMAIN);
EXPECT_EQ(0, update_count());
EXPECT_EQ(0, error_html_update_count());
@@ -657,36 +656,34 @@ TEST_F(NetErrorHelperCoreTest, SubFrameDnsErrorSpuriousStatus) {
TEST_F(NetErrorHelperCoreTest, FinishedBeforeProbe) {
// Original page starts loading.
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::NON_ERROR_PAGE);
+ NetErrorHelperCore::NON_ERROR_PAGE);
// It fails, and an error page is requested.
std::string html;
core()->GetErrorHTML(NetErrorHelperCore::MAIN_FRAME,
- NetError(net::ERR_NAME_NOT_RESOLVED),
- false, &html);
+ NetError(net::ERR_NAME_NOT_RESOLVED),
+ false, &html);
// Should have returned a local error page indicating a probe may run.
- EXPECT_EQ(ProbeErrorString(chrome_common_net::DNS_PROBE_POSSIBLE), html);
+ EXPECT_EQ(ProbeErrorString(DNS_PROBE_POSSIBLE), html);
// Error page loads.
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::ERROR_PAGE);
+ NetErrorHelperCore::ERROR_PAGE);
core()->OnCommitLoad(NetErrorHelperCore::MAIN_FRAME, error_url());
core()->OnFinishLoad(NetErrorHelperCore::MAIN_FRAME);
EXPECT_EQ(0, update_count());
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_STARTED);
+ core()->OnNetErrorInfo(DNS_PROBE_STARTED);
EXPECT_EQ(1, update_count());
- EXPECT_EQ(ProbeErrorString(chrome_common_net::DNS_PROBE_STARTED),
- last_error_html());
+ EXPECT_EQ(ProbeErrorString(DNS_PROBE_STARTED), last_error_html());
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_FINISHED_NXDOMAIN);
+ core()->OnNetErrorInfo(DNS_PROBE_FINISHED_NXDOMAIN);
EXPECT_EQ(2, update_count());
- EXPECT_EQ(ProbeErrorString(chrome_common_net::DNS_PROBE_FINISHED_NXDOMAIN),
- last_error_html());
+ EXPECT_EQ(ProbeErrorString(DNS_PROBE_FINISHED_NXDOMAIN), last_error_html());
// Any other probe updates should be ignored.
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_STARTED);
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_FINISHED_NXDOMAIN);
+ core()->OnNetErrorInfo(DNS_PROBE_STARTED);
+ core()->OnNetErrorInfo(DNS_PROBE_FINISHED_NXDOMAIN);
EXPECT_EQ(2, update_count());
EXPECT_EQ(0, error_html_update_count());
}
@@ -695,32 +692,32 @@ TEST_F(NetErrorHelperCoreTest, FinishedBeforeProbe) {
TEST_F(NetErrorHelperCoreTest, FinishedBeforeProbeNotRun) {
// Original page starts loading.
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::NON_ERROR_PAGE);
+ NetErrorHelperCore::NON_ERROR_PAGE);
// It fails, and an error page is requested.
std::string html;
core()->GetErrorHTML(NetErrorHelperCore::MAIN_FRAME,
- NetError(net::ERR_NAME_NOT_RESOLVED),
- false, &html);
+ NetError(net::ERR_NAME_NOT_RESOLVED),
+ false, &html);
// Should have returned a local error page indicating a probe may run.
- EXPECT_EQ(ProbeErrorString(chrome_common_net::DNS_PROBE_POSSIBLE), html);
+ EXPECT_EQ(ProbeErrorString(DNS_PROBE_POSSIBLE), html);
// Error page loads.
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::ERROR_PAGE);
+ NetErrorHelperCore::ERROR_PAGE);
core()->OnCommitLoad(NetErrorHelperCore::MAIN_FRAME, error_url());
core()->OnFinishLoad(NetErrorHelperCore::MAIN_FRAME);
EXPECT_EQ(0, update_count());
// When the not run status arrives, the page should revert to the normal dns
// error page.
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_NOT_RUN);
+ core()->OnNetErrorInfo(DNS_PROBE_NOT_RUN);
EXPECT_EQ(1, update_count());
EXPECT_EQ(NetErrorString(net::ERR_NAME_NOT_RESOLVED), last_error_html());
// Any other probe updates should be ignored.
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_STARTED);
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_FINISHED_NXDOMAIN);
+ core()->OnNetErrorInfo(DNS_PROBE_STARTED);
+ core()->OnNetErrorInfo(DNS_PROBE_FINISHED_NXDOMAIN);
EXPECT_EQ(1, update_count());
EXPECT_EQ(0, error_html_update_count());
}
@@ -729,36 +726,35 @@ TEST_F(NetErrorHelperCoreTest, FinishedBeforeProbeNotRun) {
TEST_F(NetErrorHelperCoreTest, FinishedBeforeProbeInconclusive) {
// Original page starts loading.
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::NON_ERROR_PAGE);
+ NetErrorHelperCore::NON_ERROR_PAGE);
// It fails, and an error page is requested.
std::string html;
core()->GetErrorHTML(NetErrorHelperCore::MAIN_FRAME,
- NetError(net::ERR_NAME_NOT_RESOLVED),
- false, &html);
+ NetError(net::ERR_NAME_NOT_RESOLVED),
+ false, &html);
// Should have returned a local error page indicating a probe may run.
- EXPECT_EQ(ProbeErrorString(chrome_common_net::DNS_PROBE_POSSIBLE), html);
+ EXPECT_EQ(ProbeErrorString(DNS_PROBE_POSSIBLE), html);
// Error page loads.
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::ERROR_PAGE);
+ NetErrorHelperCore::ERROR_PAGE);
core()->OnCommitLoad(NetErrorHelperCore::MAIN_FRAME, error_url());
core()->OnFinishLoad(NetErrorHelperCore::MAIN_FRAME);
EXPECT_EQ(0, update_count());
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_STARTED);
+ core()->OnNetErrorInfo(DNS_PROBE_STARTED);
EXPECT_EQ(1, update_count());
- EXPECT_EQ(ProbeErrorString(chrome_common_net::DNS_PROBE_STARTED),
- last_error_html());
+ EXPECT_EQ(ProbeErrorString(DNS_PROBE_STARTED), last_error_html());
// When the inconclusive status arrives, the page should revert to the normal
// dns error page.
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_FINISHED_INCONCLUSIVE);
+ core()->OnNetErrorInfo(DNS_PROBE_FINISHED_INCONCLUSIVE);
EXPECT_EQ(2, update_count());
EXPECT_EQ(NetErrorString(net::ERR_NAME_NOT_RESOLVED), last_error_html());
// Any other probe updates should be ignored.
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_FINISHED_INCONCLUSIVE);
+ core()->OnNetErrorInfo(DNS_PROBE_FINISHED_INCONCLUSIVE);
EXPECT_EQ(2, update_count());
EXPECT_EQ(0, error_html_update_count());
}
@@ -767,37 +763,36 @@ TEST_F(NetErrorHelperCoreTest, FinishedBeforeProbeInconclusive) {
TEST_F(NetErrorHelperCoreTest, FinishedBeforeProbeNoInternet) {
// Original page starts loading.
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::NON_ERROR_PAGE);
+ NetErrorHelperCore::NON_ERROR_PAGE);
// It fails, and an error page is requested.
std::string html;
core()->GetErrorHTML(NetErrorHelperCore::MAIN_FRAME,
- NetError(net::ERR_NAME_NOT_RESOLVED),
- false, &html);
+ NetError(net::ERR_NAME_NOT_RESOLVED),
+ false, &html);
// Should have returned a local error page indicating a probe may run.
- EXPECT_EQ(ProbeErrorString(chrome_common_net::DNS_PROBE_POSSIBLE), html);
+ EXPECT_EQ(ProbeErrorString(DNS_PROBE_POSSIBLE), html);
// Error page loads.
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::ERROR_PAGE);
+ NetErrorHelperCore::ERROR_PAGE);
core()->OnCommitLoad(NetErrorHelperCore::MAIN_FRAME, error_url());
core()->OnFinishLoad(NetErrorHelperCore::MAIN_FRAME);
EXPECT_EQ(0, update_count());
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_STARTED);
+ core()->OnNetErrorInfo(DNS_PROBE_STARTED);
EXPECT_EQ(1, update_count());
- EXPECT_EQ(ProbeErrorString(chrome_common_net::DNS_PROBE_STARTED),
- last_error_html());
+ EXPECT_EQ(ProbeErrorString(DNS_PROBE_STARTED), last_error_html());
// When the inconclusive status arrives, the page should revert to the normal
// dns error page.
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_FINISHED_NO_INTERNET);
+ core()->OnNetErrorInfo(DNS_PROBE_FINISHED_NO_INTERNET);
EXPECT_EQ(2, update_count());
- EXPECT_EQ(ProbeErrorString(chrome_common_net::DNS_PROBE_FINISHED_NO_INTERNET),
+ EXPECT_EQ(ProbeErrorString(DNS_PROBE_FINISHED_NO_INTERNET),
last_error_html());
// Any other probe updates should be ignored.
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_FINISHED_NO_INTERNET);
+ core()->OnNetErrorInfo(DNS_PROBE_FINISHED_NO_INTERNET);
EXPECT_EQ(2, update_count());
EXPECT_EQ(0, error_html_update_count());
}
@@ -806,37 +801,35 @@ TEST_F(NetErrorHelperCoreTest, FinishedBeforeProbeNoInternet) {
TEST_F(NetErrorHelperCoreTest, FinishedBeforeProbeBadConfig) {
// Original page starts loading.
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::NON_ERROR_PAGE);
+ NetErrorHelperCore::NON_ERROR_PAGE);
// It fails, and an error page is requested.
std::string html;
core()->GetErrorHTML(NetErrorHelperCore::MAIN_FRAME,
- NetError(net::ERR_NAME_NOT_RESOLVED),
- false, &html);
+ NetError(net::ERR_NAME_NOT_RESOLVED),
+ false, &html);
// Should have returned a local error page indicating a probe may run.
- EXPECT_EQ(ProbeErrorString(chrome_common_net::DNS_PROBE_POSSIBLE), html);
+ EXPECT_EQ(ProbeErrorString(DNS_PROBE_POSSIBLE), html);
// Error page loads.
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::ERROR_PAGE);
+ NetErrorHelperCore::ERROR_PAGE);
core()->OnCommitLoad(NetErrorHelperCore::MAIN_FRAME, error_url());
core()->OnFinishLoad(NetErrorHelperCore::MAIN_FRAME);
EXPECT_EQ(0, update_count());
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_STARTED);
+ core()->OnNetErrorInfo(DNS_PROBE_STARTED);
EXPECT_EQ(1, update_count());
- EXPECT_EQ(ProbeErrorString(chrome_common_net::DNS_PROBE_STARTED),
- last_error_html());
+ EXPECT_EQ(ProbeErrorString(DNS_PROBE_STARTED), last_error_html());
// When the inconclusive status arrives, the page should revert to the normal
// dns error page.
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_FINISHED_BAD_CONFIG);
+ core()->OnNetErrorInfo(DNS_PROBE_FINISHED_BAD_CONFIG);
EXPECT_EQ(2, update_count());
- EXPECT_EQ(ProbeErrorString(chrome_common_net::DNS_PROBE_FINISHED_BAD_CONFIG),
- last_error_html());
+ EXPECT_EQ(ProbeErrorString(DNS_PROBE_FINISHED_BAD_CONFIG), last_error_html());
// Any other probe updates should be ignored.
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_FINISHED_BAD_CONFIG);
+ core()->OnNetErrorInfo(DNS_PROBE_FINISHED_BAD_CONFIG);
EXPECT_EQ(2, update_count());
EXPECT_EQ(0, error_html_update_count());
}
@@ -846,41 +839,39 @@ TEST_F(NetErrorHelperCoreTest, FinishedBeforeProbeBadConfig) {
TEST_F(NetErrorHelperCoreTest, FinishedAfterStartProbe) {
// Original page starts loading.
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::NON_ERROR_PAGE);
+ NetErrorHelperCore::NON_ERROR_PAGE);
// It fails, and an error page is requested.
std::string html;
core()->GetErrorHTML(NetErrorHelperCore::MAIN_FRAME,
- NetError(net::ERR_NAME_NOT_RESOLVED),
- false, &html);
+ NetError(net::ERR_NAME_NOT_RESOLVED),
+ false, &html);
// Should have returned a local error page indicating a probe may run.
- EXPECT_EQ(ProbeErrorString(chrome_common_net::DNS_PROBE_POSSIBLE), html);
+ EXPECT_EQ(ProbeErrorString(DNS_PROBE_POSSIBLE), html);
// Error page loads.
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::ERROR_PAGE);
+ NetErrorHelperCore::ERROR_PAGE);
core()->OnCommitLoad(NetErrorHelperCore::MAIN_FRAME, error_url());
// Nothing should be done when a probe status comes in before loading
// finishes.
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_STARTED);
+ core()->OnNetErrorInfo(DNS_PROBE_STARTED);
EXPECT_EQ(0, update_count());
// When loading finishes, however, the buffered probe status should be sent
// to the page.
core()->OnFinishLoad(NetErrorHelperCore::MAIN_FRAME);
EXPECT_EQ(1, update_count());
- EXPECT_EQ(ProbeErrorString(chrome_common_net::DNS_PROBE_STARTED),
- last_error_html());
+ EXPECT_EQ(ProbeErrorString(DNS_PROBE_STARTED), last_error_html());
// Should update the page again when the probe result comes in.
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_FINISHED_NXDOMAIN);
+ core()->OnNetErrorInfo(DNS_PROBE_FINISHED_NXDOMAIN);
EXPECT_EQ(2, update_count());
- EXPECT_EQ(ProbeErrorString(chrome_common_net::DNS_PROBE_FINISHED_NXDOMAIN),
- last_error_html());
+ EXPECT_EQ(ProbeErrorString(DNS_PROBE_FINISHED_NXDOMAIN), last_error_html());
// Any other probe updates should be ignored.
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_NOT_RUN);
+ core()->OnNetErrorInfo(DNS_PROBE_NOT_RUN);
EXPECT_EQ(2, update_count());
}
@@ -889,39 +880,33 @@ TEST_F(NetErrorHelperCoreTest, FinishedAfterStartProbe) {
TEST_F(NetErrorHelperCoreTest, FinishedBeforeProbePost) {
// Original page starts loading.
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::NON_ERROR_PAGE);
+ NetErrorHelperCore::NON_ERROR_PAGE);
// It fails, and an error page is requested.
std::string html;
core()->GetErrorHTML(NetErrorHelperCore::MAIN_FRAME,
- NetError(net::ERR_NAME_NOT_RESOLVED),
- true, &html);
+ NetError(net::ERR_NAME_NOT_RESOLVED),
+ true, &html);
// Should have returned a local error page indicating a probe may run.
- EXPECT_EQ(ErrorToString(
- ProbeError(chrome_common_net::DNS_PROBE_POSSIBLE),
- true),
- html);
+ EXPECT_EQ(ErrorToString(ProbeError(DNS_PROBE_POSSIBLE), true), html);
// Error page loads.
EXPECT_EQ(0, enable_page_helper_functions_count());
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::ERROR_PAGE);
+ NetErrorHelperCore::ERROR_PAGE);
core()->OnCommitLoad(NetErrorHelperCore::MAIN_FRAME, error_url());
core()->OnFinishLoad(NetErrorHelperCore::MAIN_FRAME);
EXPECT_EQ(0, update_count());
EXPECT_EQ(1, enable_page_helper_functions_count());
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_STARTED);
+ core()->OnNetErrorInfo(DNS_PROBE_STARTED);
EXPECT_EQ(1, update_count());
- EXPECT_EQ(ErrorToString(
- ProbeError(chrome_common_net::DNS_PROBE_STARTED), true),
+ EXPECT_EQ(ErrorToString(ProbeError(DNS_PROBE_STARTED), true),
last_error_html());
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_FINISHED_NXDOMAIN);
+ core()->OnNetErrorInfo(DNS_PROBE_FINISHED_NXDOMAIN);
EXPECT_EQ(2, update_count());
- EXPECT_EQ(ErrorToString(
- ProbeError(chrome_common_net::DNS_PROBE_FINISHED_NXDOMAIN),
- true),
+ EXPECT_EQ(ErrorToString(ProbeError(DNS_PROBE_FINISHED_NXDOMAIN), true),
last_error_html());
EXPECT_EQ(0, error_html_update_count());
}
@@ -930,24 +915,24 @@ TEST_F(NetErrorHelperCoreTest, FinishedBeforeProbePost) {
TEST_F(NetErrorHelperCoreTest, ProbeFinishesEarly) {
// Original page starts loading.
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::NON_ERROR_PAGE);
+ NetErrorHelperCore::NON_ERROR_PAGE);
// It fails, and an error page is requested.
std::string html;
core()->GetErrorHTML(NetErrorHelperCore::MAIN_FRAME,
- NetError(net::ERR_NAME_NOT_RESOLVED),
- false, &html);
+ NetError(net::ERR_NAME_NOT_RESOLVED),
+ false, &html);
// Should have returned a local error page indicating a probe may run.
- EXPECT_EQ(ProbeErrorString(chrome_common_net::DNS_PROBE_POSSIBLE), html);
+ EXPECT_EQ(ProbeErrorString(DNS_PROBE_POSSIBLE), html);
// Error page starts loading.
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::ERROR_PAGE);
+ NetErrorHelperCore::ERROR_PAGE);
// Nothing should be done when the probe statuses come in before loading
// finishes.
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_STARTED);
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_FINISHED_NXDOMAIN);
+ core()->OnNetErrorInfo(DNS_PROBE_STARTED);
+ core()->OnNetErrorInfo(DNS_PROBE_FINISHED_NXDOMAIN);
EXPECT_EQ(0, update_count());
core()->OnCommitLoad(NetErrorHelperCore::MAIN_FRAME, error_url());
@@ -957,12 +942,11 @@ TEST_F(NetErrorHelperCoreTest, ProbeFinishesEarly) {
// to the page.
core()->OnFinishLoad(NetErrorHelperCore::MAIN_FRAME);
EXPECT_EQ(1, update_count());
- EXPECT_EQ(ProbeErrorString(chrome_common_net::DNS_PROBE_FINISHED_NXDOMAIN),
- last_error_html());
+ EXPECT_EQ(ProbeErrorString(DNS_PROBE_FINISHED_NXDOMAIN), last_error_html());
// Any other probe updates should be ignored.
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_STARTED);
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_FINISHED_NXDOMAIN);
+ core()->OnNetErrorInfo(DNS_PROBE_STARTED);
+ core()->OnNetErrorInfo(DNS_PROBE_FINISHED_NXDOMAIN);
EXPECT_EQ(1, update_count());
}
@@ -971,58 +955,56 @@ TEST_F(NetErrorHelperCoreTest, ProbeFinishesEarly) {
TEST_F(NetErrorHelperCoreTest, TwoErrorsWithProbes) {
// Original page starts loading.
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::NON_ERROR_PAGE);
+ NetErrorHelperCore::NON_ERROR_PAGE);
// It fails, and an error page is requested.
std::string html;
core()->GetErrorHTML(NetErrorHelperCore::MAIN_FRAME,
- NetError(net::ERR_NAME_NOT_RESOLVED),
- false, &html);
+ NetError(net::ERR_NAME_NOT_RESOLVED),
+ false, &html);
// Should have returned a local error page indicating a probe may run.
- EXPECT_EQ(ProbeErrorString(chrome_common_net::DNS_PROBE_POSSIBLE), html);
+ EXPECT_EQ(ProbeErrorString(DNS_PROBE_POSSIBLE), html);
// Error page loads.
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::ERROR_PAGE);
+ NetErrorHelperCore::ERROR_PAGE);
core()->OnCommitLoad(NetErrorHelperCore::MAIN_FRAME, error_url());
core()->OnFinishLoad(NetErrorHelperCore::MAIN_FRAME);
// Probe results come in.
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_STARTED);
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_FINISHED_NXDOMAIN);
+ core()->OnNetErrorInfo(DNS_PROBE_STARTED);
+ core()->OnNetErrorInfo(DNS_PROBE_FINISHED_NXDOMAIN);
EXPECT_EQ(2, update_count());
- EXPECT_EQ(ProbeErrorString(chrome_common_net::DNS_PROBE_FINISHED_NXDOMAIN),
- last_error_html());
+ EXPECT_EQ(ProbeErrorString(DNS_PROBE_FINISHED_NXDOMAIN), last_error_html());
// The process starts again.
// Normal page starts loading.
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::NON_ERROR_PAGE);
+ NetErrorHelperCore::NON_ERROR_PAGE);
// It fails, and an error page is requested.
core()->GetErrorHTML(NetErrorHelperCore::MAIN_FRAME,
- NetError(net::ERR_NAME_NOT_RESOLVED),
- false, &html);
+ NetError(net::ERR_NAME_NOT_RESOLVED),
+ false, &html);
// Should have returned a local error page indicating a probe may run.
- EXPECT_EQ(ProbeErrorString(chrome_common_net::DNS_PROBE_POSSIBLE), html);
+ EXPECT_EQ(ProbeErrorString(DNS_PROBE_POSSIBLE), html);
// Error page loads.
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::ERROR_PAGE);
+ NetErrorHelperCore::ERROR_PAGE);
core()->OnCommitLoad(NetErrorHelperCore::MAIN_FRAME, error_url());
core()->OnFinishLoad(NetErrorHelperCore::MAIN_FRAME);
EXPECT_EQ(2, update_count());
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_STARTED);
+ core()->OnNetErrorInfo(DNS_PROBE_STARTED);
EXPECT_EQ(3, update_count());
- EXPECT_EQ(ProbeErrorString(chrome_common_net::DNS_PROBE_STARTED),
- last_error_html());
+ EXPECT_EQ(ProbeErrorString(DNS_PROBE_STARTED), last_error_html());
// The probe returns a different result this time.
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_FINISHED_NO_INTERNET);
+ core()->OnNetErrorInfo(DNS_PROBE_FINISHED_NO_INTERNET);
EXPECT_EQ(4, update_count());
- EXPECT_EQ(ProbeErrorString(chrome_common_net::DNS_PROBE_FINISHED_NO_INTERNET),
+ EXPECT_EQ(ProbeErrorString(DNS_PROBE_FINISHED_NO_INTERNET),
last_error_html());
EXPECT_EQ(0, error_html_update_count());
}
@@ -1033,19 +1015,19 @@ TEST_F(NetErrorHelperCoreTest, TwoErrorsWithProbes) {
TEST_F(NetErrorHelperCoreTest, TwoErrorsWithProbesAfterSecondStarts) {
// Original page starts loading.
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::NON_ERROR_PAGE);
+ NetErrorHelperCore::NON_ERROR_PAGE);
// It fails, and an error page is requested.
std::string html;
core()->GetErrorHTML(NetErrorHelperCore::MAIN_FRAME,
- NetError(net::ERR_NAME_NOT_RESOLVED),
- false, &html);
+ NetError(net::ERR_NAME_NOT_RESOLVED),
+ false, &html);
// Should have returned a local error page indicating a probe may run.
- EXPECT_EQ(ProbeErrorString(chrome_common_net::DNS_PROBE_POSSIBLE), html);
+ EXPECT_EQ(ProbeErrorString(DNS_PROBE_POSSIBLE), html);
// Error page loads.
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::ERROR_PAGE);
+ NetErrorHelperCore::ERROR_PAGE);
core()->OnCommitLoad(NetErrorHelperCore::MAIN_FRAME, error_url());
core()->OnFinishLoad(NetErrorHelperCore::MAIN_FRAME);
@@ -1053,35 +1035,33 @@ TEST_F(NetErrorHelperCoreTest, TwoErrorsWithProbesAfterSecondStarts) {
// Normal page starts loading.
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::NON_ERROR_PAGE);
+ NetErrorHelperCore::NON_ERROR_PAGE);
// It fails, and an error page is requested.
core()->GetErrorHTML(NetErrorHelperCore::MAIN_FRAME,
- NetError(net::ERR_NAME_NOT_RESOLVED),
- false, &html);
+ NetError(net::ERR_NAME_NOT_RESOLVED),
+ false, &html);
// Should have returned a local error page indicating a probe may run.
- EXPECT_EQ(ProbeErrorString(chrome_common_net::DNS_PROBE_POSSIBLE), html);
+ EXPECT_EQ(ProbeErrorString(DNS_PROBE_POSSIBLE), html);
// Error page starts to load.
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::ERROR_PAGE);
+ NetErrorHelperCore::ERROR_PAGE);
// Probe results come in, and the first page is updated.
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_STARTED);
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_FINISHED_NXDOMAIN);
+ core()->OnNetErrorInfo(DNS_PROBE_STARTED);
+ core()->OnNetErrorInfo(DNS_PROBE_FINISHED_NXDOMAIN);
EXPECT_EQ(2, update_count());
- EXPECT_EQ(ProbeErrorString(chrome_common_net::DNS_PROBE_FINISHED_NXDOMAIN),
- last_error_html());
+ EXPECT_EQ(ProbeErrorString(DNS_PROBE_FINISHED_NXDOMAIN), last_error_html());
// Second page finishes loading, and is updated using the same probe result.
core()->OnCommitLoad(NetErrorHelperCore::MAIN_FRAME, error_url());
core()->OnFinishLoad(NetErrorHelperCore::MAIN_FRAME);
EXPECT_EQ(3, update_count());
- EXPECT_EQ(ProbeErrorString(chrome_common_net::DNS_PROBE_FINISHED_NXDOMAIN),
- last_error_html());
+ EXPECT_EQ(ProbeErrorString(DNS_PROBE_FINISHED_NXDOMAIN), last_error_html());
// Other probe results should be ignored.
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_FINISHED_NO_INTERNET);
+ core()->OnNetErrorInfo(DNS_PROBE_FINISHED_NO_INTERNET);
EXPECT_EQ(3, update_count());
EXPECT_EQ(0, error_html_update_count());
}
@@ -1090,48 +1070,48 @@ TEST_F(NetErrorHelperCoreTest, TwoErrorsWithProbesAfterSecondStarts) {
TEST_F(NetErrorHelperCoreTest, ErrorPageLoadInterrupted) {
// Original page starts loading.
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::NON_ERROR_PAGE);
+ NetErrorHelperCore::NON_ERROR_PAGE);
// It fails, and an error page is requested.
std::string html;
core()->GetErrorHTML(NetErrorHelperCore::MAIN_FRAME,
- NetError(net::ERR_NAME_NOT_RESOLVED),
- false, &html);
+ NetError(net::ERR_NAME_NOT_RESOLVED),
+ false, &html);
// Should have returned a local error page indicating a probe may run.
- EXPECT_EQ(ProbeErrorString(chrome_common_net::DNS_PROBE_POSSIBLE), html);
+ EXPECT_EQ(ProbeErrorString(DNS_PROBE_POSSIBLE), html);
// Error page starts loading.
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::ERROR_PAGE);
+ NetErrorHelperCore::ERROR_PAGE);
// Probe statuses come in, but should be ignored.
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_STARTED);
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_FINISHED_NXDOMAIN);
+ core()->OnNetErrorInfo(DNS_PROBE_STARTED);
+ core()->OnNetErrorInfo(DNS_PROBE_FINISHED_NXDOMAIN);
EXPECT_EQ(0, update_count());
// A new navigation begins while the error page is loading.
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::NON_ERROR_PAGE);
+ NetErrorHelperCore::NON_ERROR_PAGE);
// And fails.
core()->GetErrorHTML(NetErrorHelperCore::MAIN_FRAME,
- NetError(net::ERR_NAME_NOT_RESOLVED),
- false, &html);
+ NetError(net::ERR_NAME_NOT_RESOLVED),
+ false, &html);
// Should have returned a local error page indicating a probe may run.
- EXPECT_EQ(ProbeErrorString(chrome_common_net::DNS_PROBE_POSSIBLE), html);
+ EXPECT_EQ(ProbeErrorString(DNS_PROBE_POSSIBLE), html);
// Error page finishes loading.
core()->OnCommitLoad(NetErrorHelperCore::MAIN_FRAME, error_url());
core()->OnFinishLoad(NetErrorHelperCore::MAIN_FRAME);
// Probe results come in.
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_STARTED);
+ core()->OnNetErrorInfo(DNS_PROBE_STARTED);
EXPECT_EQ(1, update_count());
- EXPECT_EQ(ProbeErrorString(chrome_common_net::DNS_PROBE_STARTED),
+ EXPECT_EQ(ProbeErrorString(DNS_PROBE_STARTED),
last_error_html());
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_FINISHED_NO_INTERNET);
+ core()->OnNetErrorInfo(DNS_PROBE_FINISHED_NO_INTERNET);
EXPECT_EQ(2, update_count());
- EXPECT_EQ(ProbeErrorString(chrome_common_net::DNS_PROBE_FINISHED_NO_INTERNET),
+ EXPECT_EQ(ProbeErrorString(DNS_PROBE_FINISHED_NO_INTERNET),
last_error_html());
EXPECT_EQ(0, error_html_update_count());
}
@@ -1145,7 +1125,7 @@ TEST_F(NetErrorHelperCoreTest, NoCorrectionsForHttps) {
// Original page starts loading.
EnableNavigationCorrections();
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::NON_ERROR_PAGE);
+ NetErrorHelperCore::NON_ERROR_PAGE);
// The HTTPS page fails to load.
std::string html;
@@ -1153,8 +1133,7 @@ TEST_F(NetErrorHelperCoreTest, NoCorrectionsForHttps) {
error.unreachableURL = GURL(kFailedHttpsUrl);
core()->GetErrorHTML(NetErrorHelperCore::MAIN_FRAME, error, false, &html);
- blink::WebURLError probe_error =
- ProbeError(chrome_common_net::DNS_PROBE_POSSIBLE);
+ blink::WebURLError probe_error = ProbeError(DNS_PROBE_POSSIBLE);
probe_error.unreachableURL = GURL(kFailedHttpsUrl);
EXPECT_EQ(ErrorToString(probe_error, false), html);
EXPECT_FALSE(is_url_being_fetched());
@@ -1162,7 +1141,7 @@ TEST_F(NetErrorHelperCoreTest, NoCorrectionsForHttps) {
// The blank page loads, no error page is loaded.
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::ERROR_PAGE);
+ NetErrorHelperCore::ERROR_PAGE);
core()->OnCommitLoad(NetErrorHelperCore::MAIN_FRAME, error_url());
core()->OnFinishLoad(NetErrorHelperCore::MAIN_FRAME);
EXPECT_FALSE(is_url_being_fetched());
@@ -1170,12 +1149,12 @@ TEST_F(NetErrorHelperCoreTest, NoCorrectionsForHttps) {
// Page is updated in response to DNS probes as normal.
EXPECT_EQ(0, update_count());
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_STARTED);
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_FINISHED_NXDOMAIN);
+ core()->OnNetErrorInfo(DNS_PROBE_STARTED);
+ core()->OnNetErrorInfo(DNS_PROBE_FINISHED_NXDOMAIN);
EXPECT_EQ(2, update_count());
EXPECT_FALSE(last_error_page_params());
blink::WebURLError final_probe_error =
- ProbeError(chrome_common_net::DNS_PROBE_FINISHED_NXDOMAIN);
+ ProbeError(DNS_PROBE_FINISHED_NXDOMAIN);
final_probe_error.unreachableURL = GURL(kFailedHttpsUrl);
EXPECT_EQ(ErrorToString(final_probe_error, false), last_error_html());
}
@@ -1186,13 +1165,13 @@ TEST_F(NetErrorHelperCoreTest, CorrectionsReceivedBeforeProbe) {
// Original page starts loading.
EnableNavigationCorrections();
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::NON_ERROR_PAGE);
+ NetErrorHelperCore::NON_ERROR_PAGE);
// It fails.
std::string html;
core()->GetErrorHTML(NetErrorHelperCore::MAIN_FRAME,
- NetError(net::ERR_NAME_NOT_RESOLVED),
- false, &html);
+ NetError(net::ERR_NAME_NOT_RESOLVED),
+ false, &html);
EXPECT_TRUE(html.empty());
EXPECT_FALSE(is_url_being_fetched());
EXPECT_FALSE(last_error_page_params());
@@ -1224,8 +1203,8 @@ TEST_F(NetErrorHelperCoreTest, CorrectionsReceivedBeforeProbe) {
core()->OnFinishLoad(NetErrorHelperCore::MAIN_FRAME);
// Any probe statuses should be ignored.
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_STARTED);
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_FINISHED_NXDOMAIN);
+ core()->OnNetErrorInfo(DNS_PROBE_STARTED);
+ core()->OnNetErrorInfo(DNS_PROBE_FINISHED_NXDOMAIN);
EXPECT_EQ(0, update_count());
EXPECT_EQ(1, error_html_update_count());
@@ -1237,26 +1216,26 @@ TEST_F(NetErrorHelperCoreTest, CorrectionsRetrievedAfterProbes) {
// Original page starts loading.
EnableNavigationCorrections();
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::NON_ERROR_PAGE);
+ NetErrorHelperCore::NON_ERROR_PAGE);
// It fails, and corrections are requested.
std::string html;
core()->GetErrorHTML(NetErrorHelperCore::MAIN_FRAME,
- NetError(net::ERR_NAME_NOT_RESOLVED),
- false, &html);
+ NetError(net::ERR_NAME_NOT_RESOLVED),
+ false, &html);
EXPECT_TRUE(html.empty());
// The blank page loads.
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::ERROR_PAGE);
+ NetErrorHelperCore::ERROR_PAGE);
core()->OnCommitLoad(NetErrorHelperCore::MAIN_FRAME, error_url());
core()->OnFinishLoad(NetErrorHelperCore::MAIN_FRAME);
EXPECT_TRUE(is_url_being_fetched());
EXPECT_FALSE(last_error_page_params());
// Probe statuses should be ignored.
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_STARTED);
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_FINISHED_NXDOMAIN);
+ core()->OnNetErrorInfo(DNS_PROBE_STARTED);
+ core()->OnNetErrorInfo(DNS_PROBE_FINISHED_NXDOMAIN);
EXPECT_EQ(0, update_count());
EXPECT_EQ(0, error_html_update_count());
EXPECT_FALSE(last_error_page_params());
@@ -1272,7 +1251,7 @@ TEST_F(NetErrorHelperCoreTest, CorrectionsRetrievedAfterProbes) {
// Corrections load.
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::ERROR_PAGE);
+ NetErrorHelperCore::ERROR_PAGE);
core()->OnCommitLoad(NetErrorHelperCore::MAIN_FRAME, error_url());
core()->OnFinishLoad(NetErrorHelperCore::MAIN_FRAME);
EXPECT_EQ(1, error_html_update_count());
@@ -1285,18 +1264,18 @@ TEST_F(NetErrorHelperCoreTest, CorrectionsFailLoadNoProbes) {
// Original page starts loading.
EnableNavigationCorrections();
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::NON_ERROR_PAGE);
+ NetErrorHelperCore::NON_ERROR_PAGE);
// It fails, and corrections are requested.
std::string html;
core()->GetErrorHTML(NetErrorHelperCore::MAIN_FRAME,
- NetError(net::ERR_CONNECTION_FAILED),
- false, &html);
+ NetError(net::ERR_CONNECTION_FAILED),
+ false, &html);
EXPECT_TRUE(html.empty());
// The blank page loads.
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::ERROR_PAGE);
+ NetErrorHelperCore::ERROR_PAGE);
core()->OnCommitLoad(NetErrorHelperCore::MAIN_FRAME, error_url());
core()->OnFinishLoad(NetErrorHelperCore::MAIN_FRAME);
@@ -1311,14 +1290,14 @@ TEST_F(NetErrorHelperCoreTest, CorrectionsFailLoadNoProbes) {
// Error page loads.
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::ERROR_PAGE);
+ NetErrorHelperCore::ERROR_PAGE);
core()->OnCommitLoad(NetErrorHelperCore::MAIN_FRAME, error_url());
core()->OnFinishLoad(NetErrorHelperCore::MAIN_FRAME);
// If probe statuses come in last from another page load, they should be
// ignored.
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_STARTED);
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_FINISHED_NXDOMAIN);
+ core()->OnNetErrorInfo(DNS_PROBE_STARTED);
+ core()->OnNetErrorInfo(DNS_PROBE_FINISHED_NXDOMAIN);
EXPECT_EQ(0, update_count());
EXPECT_EQ(1, error_html_update_count());
}
@@ -1329,18 +1308,18 @@ TEST_F(NetErrorHelperCoreTest, CorrectionsFailLoadBeforeProbe) {
// Original page starts loading.
EnableNavigationCorrections();
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::NON_ERROR_PAGE);
+ NetErrorHelperCore::NON_ERROR_PAGE);
// It fails, and corrections are requested.
std::string html;
core()->GetErrorHTML(NetErrorHelperCore::MAIN_FRAME,
- NetError(net::ERR_NAME_NOT_RESOLVED),
- false, &html);
+ NetError(net::ERR_NAME_NOT_RESOLVED),
+ false, &html);
EXPECT_TRUE(html.empty());
// The blank page loads.
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::ERROR_PAGE);
+ NetErrorHelperCore::ERROR_PAGE);
core()->OnCommitLoad(NetErrorHelperCore::MAIN_FRAME, error_url());
core()->OnFinishLoad(NetErrorHelperCore::MAIN_FRAME);
@@ -1349,29 +1328,27 @@ TEST_F(NetErrorHelperCoreTest, CorrectionsFailLoadBeforeProbe) {
NavigationCorrectionsLoadFailure();
EXPECT_EQ(1, error_html_update_count());
EXPECT_EQ(last_error_html(),
- ProbeErrorString(chrome_common_net::DNS_PROBE_POSSIBLE));
+ ProbeErrorString(DNS_PROBE_POSSIBLE));
EXPECT_FALSE(is_url_being_fetched());
EXPECT_EQ(0, update_count());
// Probe page loads.
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::ERROR_PAGE);
+ NetErrorHelperCore::ERROR_PAGE);
core()->OnCommitLoad(NetErrorHelperCore::MAIN_FRAME, error_url());
core()->OnFinishLoad(NetErrorHelperCore::MAIN_FRAME);
// Probe statuses comes in, and page is updated.
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_STARTED);
+ core()->OnNetErrorInfo(DNS_PROBE_STARTED);
EXPECT_EQ(1, update_count());
- EXPECT_EQ(ProbeErrorString(chrome_common_net::DNS_PROBE_STARTED),
- last_error_html());
+ EXPECT_EQ(ProbeErrorString(DNS_PROBE_STARTED), last_error_html());
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_FINISHED_NXDOMAIN);
+ core()->OnNetErrorInfo(DNS_PROBE_FINISHED_NXDOMAIN);
EXPECT_EQ(2, update_count());
- EXPECT_EQ(ProbeErrorString(chrome_common_net::DNS_PROBE_FINISHED_NXDOMAIN),
- last_error_html());
+ EXPECT_EQ(ProbeErrorString(DNS_PROBE_FINISHED_NXDOMAIN), last_error_html());
// The commit results in sending a second probe status, which is ignored.
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_FINISHED_NXDOMAIN);
+ core()->OnNetErrorInfo(DNS_PROBE_FINISHED_NXDOMAIN);
EXPECT_EQ(2, update_count());
EXPECT_EQ(1, error_html_update_count());
}
@@ -1381,46 +1358,44 @@ TEST_F(NetErrorHelperCoreTest, CorrectionsFailAfterProbe) {
// Original page starts loading.
EnableNavigationCorrections();
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::NON_ERROR_PAGE);
+ NetErrorHelperCore::NON_ERROR_PAGE);
// It fails, and corrections are requested.
std::string html;
core()->GetErrorHTML(NetErrorHelperCore::MAIN_FRAME,
- NetError(net::ERR_NAME_NOT_RESOLVED),
- false, &html);
+ NetError(net::ERR_NAME_NOT_RESOLVED),
+ false, &html);
EXPECT_TRUE(html.empty());
// The blank page loads.
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::ERROR_PAGE);
+ NetErrorHelperCore::ERROR_PAGE);
core()->OnCommitLoad(NetErrorHelperCore::MAIN_FRAME, error_url());
core()->OnFinishLoad(NetErrorHelperCore::MAIN_FRAME);
// Results come in, but end up being ignored.
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_STARTED);
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_FINISHED_NXDOMAIN);
+ core()->OnNetErrorInfo(DNS_PROBE_STARTED);
+ core()->OnNetErrorInfo(DNS_PROBE_FINISHED_NXDOMAIN);
EXPECT_EQ(0, update_count());
// Corrections request fails, probe pending page shown.
EXPECT_TRUE(is_url_being_fetched());
NavigationCorrectionsLoadFailure();
EXPECT_EQ(1, error_html_update_count());
- EXPECT_EQ(last_error_html(),
- ProbeErrorString(chrome_common_net::DNS_PROBE_POSSIBLE));
+ EXPECT_EQ(last_error_html(), ProbeErrorString(DNS_PROBE_POSSIBLE));
EXPECT_FALSE(is_url_being_fetched());
EXPECT_EQ(0, update_count());
// Probe page loads.
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::ERROR_PAGE);
+ NetErrorHelperCore::ERROR_PAGE);
core()->OnCommitLoad(NetErrorHelperCore::MAIN_FRAME, error_url());
core()->OnFinishLoad(NetErrorHelperCore::MAIN_FRAME);
// Probe statuses comes in, and page is updated.
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_FINISHED_NXDOMAIN);
+ core()->OnNetErrorInfo(DNS_PROBE_FINISHED_NXDOMAIN);
EXPECT_EQ(1, update_count());
- EXPECT_EQ(ProbeErrorString(chrome_common_net::DNS_PROBE_FINISHED_NXDOMAIN),
- last_error_html());
+ EXPECT_EQ(ProbeErrorString(DNS_PROBE_FINISHED_NXDOMAIN), last_error_html());
EXPECT_EQ(1, error_html_update_count());
}
@@ -1430,28 +1405,28 @@ TEST_F(NetErrorHelperCoreTest, CorrectionsInterruptedBeforeCommit) {
// Original page starts loading.
EnableNavigationCorrections();
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::NON_ERROR_PAGE);
+ NetErrorHelperCore::NON_ERROR_PAGE);
// It fails, and corrections are requested.
std::string html;
core()->GetErrorHTML(NetErrorHelperCore::MAIN_FRAME,
- NetError(net::ERR_NAME_NOT_RESOLVED),
- false, &html);
+ NetError(net::ERR_NAME_NOT_RESOLVED),
+ false, &html);
EXPECT_TRUE(html.empty());
// The blank page starts loading.
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::ERROR_PAGE);
+ NetErrorHelperCore::ERROR_PAGE);
// A new page load starts.
EXPECT_FALSE(is_url_being_fetched());
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::NON_ERROR_PAGE);
+ NetErrorHelperCore::NON_ERROR_PAGE);
// A new page load interrupts the original load.
EXPECT_FALSE(is_url_being_fetched());
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::NON_ERROR_PAGE);
+ NetErrorHelperCore::NON_ERROR_PAGE);
EXPECT_FALSE(is_url_being_fetched());
core()->OnCommitLoad(NetErrorHelperCore::MAIN_FRAME, default_url());
EXPECT_FALSE(is_url_being_fetched());
@@ -1468,24 +1443,24 @@ TEST_F(NetErrorHelperCoreTest, CorrectionsInterruptedBeforeLoad) {
// Original page starts loading.
EnableNavigationCorrections();
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::NON_ERROR_PAGE);
+ NetErrorHelperCore::NON_ERROR_PAGE);
// It fails, and corrections are requested.
std::string html;
core()->GetErrorHTML(NetErrorHelperCore::MAIN_FRAME,
- NetError(net::ERR_NAME_NOT_RESOLVED),
- false, &html);
+ NetError(net::ERR_NAME_NOT_RESOLVED),
+ false, &html);
EXPECT_TRUE(html.empty());
// The blank page starts loading and is committed.
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::ERROR_PAGE);
+ NetErrorHelperCore::ERROR_PAGE);
core()->OnCommitLoad(NetErrorHelperCore::MAIN_FRAME, error_url());
// A new page load interrupts the original load.
EXPECT_FALSE(is_url_being_fetched());
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::NON_ERROR_PAGE);
+ NetErrorHelperCore::NON_ERROR_PAGE);
EXPECT_FALSE(is_url_being_fetched());
core()->OnCommitLoad(NetErrorHelperCore::MAIN_FRAME, default_url());
EXPECT_FALSE(is_url_being_fetched());
@@ -1502,39 +1477,39 @@ TEST_F(NetErrorHelperCoreTest, CorrectionsInterrupted) {
// Original page starts loading.
EnableNavigationCorrections();
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::NON_ERROR_PAGE);
+ NetErrorHelperCore::NON_ERROR_PAGE);
// It fails, and corrections are requested.
std::string html;
core()->GetErrorHTML(NetErrorHelperCore::MAIN_FRAME,
- NetError(net::ERR_NAME_NOT_RESOLVED),
- false, &html);
+ NetError(net::ERR_NAME_NOT_RESOLVED),
+ false, &html);
EXPECT_TRUE(html.empty());
// The blank page loads.
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::ERROR_PAGE);
+ NetErrorHelperCore::ERROR_PAGE);
core()->OnCommitLoad(NetErrorHelperCore::MAIN_FRAME, error_url());
core()->OnFinishLoad(NetErrorHelperCore::MAIN_FRAME);
EXPECT_TRUE(is_url_being_fetched());
// Results come in, but end up being ignored.
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_STARTED);
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_FINISHED_NXDOMAIN);
+ core()->OnNetErrorInfo(DNS_PROBE_STARTED);
+ core()->OnNetErrorInfo(DNS_PROBE_FINISHED_NXDOMAIN);
EXPECT_EQ(0, update_count());
// A new load appears!
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::NON_ERROR_PAGE);
+ NetErrorHelperCore::NON_ERROR_PAGE);
EXPECT_FALSE(is_url_being_fetched());
// It fails, and corrections are requested again once a blank page is loaded.
core()->GetErrorHTML(NetErrorHelperCore::MAIN_FRAME,
- NetError(net::ERR_NAME_NOT_RESOLVED),
- false, &html);
+ NetError(net::ERR_NAME_NOT_RESOLVED),
+ false, &html);
EXPECT_TRUE(html.empty());
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::ERROR_PAGE);
+ NetErrorHelperCore::ERROR_PAGE);
core()->OnCommitLoad(NetErrorHelperCore::MAIN_FRAME, error_url());
EXPECT_FALSE(is_url_being_fetched());
core()->OnFinishLoad(NetErrorHelperCore::MAIN_FRAME);
@@ -1549,8 +1524,8 @@ TEST_F(NetErrorHelperCoreTest, CorrectionsInterrupted) {
EXPECT_FALSE(is_url_being_fetched());
// Probe statuses come in, and are ignored.
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_STARTED);
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_FINISHED_NXDOMAIN);
+ core()->OnNetErrorInfo(DNS_PROBE_STARTED);
+ core()->OnNetErrorInfo(DNS_PROBE_FINISHED_NXDOMAIN);
EXPECT_EQ(0, update_count());
}
@@ -1561,18 +1536,18 @@ TEST_F(NetErrorHelperCoreTest, CorrectionsStopped) {
// Original page starts loading.
EnableNavigationCorrections();
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::NON_ERROR_PAGE);
+ NetErrorHelperCore::NON_ERROR_PAGE);
// It fails, and corrections are requested.
std::string html;
core()->GetErrorHTML(NetErrorHelperCore::MAIN_FRAME,
- NetError(net::ERR_NAME_NOT_RESOLVED),
- false, &html);
+ NetError(net::ERR_NAME_NOT_RESOLVED),
+ false, &html);
EXPECT_TRUE(html.empty());
// The blank page loads.
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::ERROR_PAGE);
+ NetErrorHelperCore::ERROR_PAGE);
core()->OnCommitLoad(NetErrorHelperCore::MAIN_FRAME, error_url());
core()->OnFinishLoad(NetErrorHelperCore::MAIN_FRAME);
@@ -1581,23 +1556,23 @@ TEST_F(NetErrorHelperCoreTest, CorrectionsStopped) {
EXPECT_FALSE(is_url_being_fetched());
// Results come in, but end up being ignored.
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_STARTED);
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_FINISHED_NXDOMAIN);
+ core()->OnNetErrorInfo(DNS_PROBE_STARTED);
+ core()->OnNetErrorInfo(DNS_PROBE_FINISHED_NXDOMAIN);
EXPECT_EQ(0, update_count());
// Cross process navigation must have been cancelled, and a new load appears!
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::NON_ERROR_PAGE);
+ NetErrorHelperCore::NON_ERROR_PAGE);
// It fails, and corrections are requested again.
core()->GetErrorHTML(NetErrorHelperCore::MAIN_FRAME,
- NetError(net::ERR_NAME_NOT_RESOLVED),
- false, &html);
+ NetError(net::ERR_NAME_NOT_RESOLVED),
+ false, &html);
EXPECT_TRUE(html.empty());
// The blank page loads again.
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::ERROR_PAGE);
+ NetErrorHelperCore::ERROR_PAGE);
core()->OnCommitLoad(NetErrorHelperCore::MAIN_FRAME, error_url());
core()->OnFinishLoad(NetErrorHelperCore::MAIN_FRAME);
EXPECT_TRUE(is_url_being_fetched());
@@ -1605,26 +1580,23 @@ TEST_F(NetErrorHelperCoreTest, CorrectionsStopped) {
// Corrections request fails, probe pending page shown.
NavigationCorrectionsLoadFailure();
EXPECT_EQ(1, error_html_update_count());
- EXPECT_EQ(last_error_html(),
- ProbeErrorString(chrome_common_net::DNS_PROBE_POSSIBLE));
+ EXPECT_EQ(last_error_html(), ProbeErrorString(DNS_PROBE_POSSIBLE));
EXPECT_FALSE(is_url_being_fetched());
// Probe page loads.
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::ERROR_PAGE);
+ NetErrorHelperCore::ERROR_PAGE);
core()->OnCommitLoad(NetErrorHelperCore::MAIN_FRAME, error_url());
core()->OnFinishLoad(NetErrorHelperCore::MAIN_FRAME);
// Probe statuses comes in, and page is updated.
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_STARTED);
- EXPECT_EQ(ProbeErrorString(chrome_common_net::DNS_PROBE_STARTED),
- last_error_html());
+ core()->OnNetErrorInfo(DNS_PROBE_STARTED);
+ EXPECT_EQ(ProbeErrorString(DNS_PROBE_STARTED), last_error_html());
EXPECT_EQ(1, update_count());
- core()->OnNetErrorInfo(chrome_common_net::DNS_PROBE_FINISHED_NXDOMAIN);
+ core()->OnNetErrorInfo(DNS_PROBE_FINISHED_NXDOMAIN);
EXPECT_EQ(2, update_count());
- EXPECT_EQ(ProbeErrorString(chrome_common_net::DNS_PROBE_FINISHED_NXDOMAIN),
- last_error_html());
+ EXPECT_EQ(ProbeErrorString(DNS_PROBE_FINISHED_NXDOMAIN), last_error_html());
EXPECT_EQ(1, error_html_update_count());
}
@@ -1634,18 +1606,18 @@ TEST_F(NetErrorHelperCoreTest, CorrectionsDisabledBeforeFetch) {
// Original page starts loading.
EnableNavigationCorrections();
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::NON_ERROR_PAGE);
+ NetErrorHelperCore::NON_ERROR_PAGE);
// It fails, and corrections are requested.
std::string html;
core()->GetErrorHTML(NetErrorHelperCore::MAIN_FRAME,
- NetError(net::ERR_NAME_NOT_RESOLVED),
- false, &html);
+ NetError(net::ERR_NAME_NOT_RESOLVED),
+ false, &html);
EXPECT_TRUE(html.empty());
// The blank page loads.
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::ERROR_PAGE);
+ NetErrorHelperCore::ERROR_PAGE);
// Corrections is disabled.
DisableNavigationCorrections();
core()->OnCommitLoad(NetErrorHelperCore::MAIN_FRAME, error_url());
@@ -1663,7 +1635,7 @@ TEST_F(NetErrorHelperCoreTest, CorrectionsDisabledBeforeFetch) {
// Corrections load.
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::ERROR_PAGE);
+ NetErrorHelperCore::ERROR_PAGE);
core()->OnCommitLoad(NetErrorHelperCore::MAIN_FRAME, error_url());
core()->OnFinishLoad(NetErrorHelperCore::MAIN_FRAME);
EXPECT_EQ(1, error_html_update_count());
@@ -1676,18 +1648,18 @@ TEST_F(NetErrorHelperCoreTest, CorrectionsDisabledDuringFetch) {
// Original page starts loading.
EnableNavigationCorrections();
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::NON_ERROR_PAGE);
+ NetErrorHelperCore::NON_ERROR_PAGE);
// It fails, and corrections are requested.
std::string html;
core()->GetErrorHTML(NetErrorHelperCore::MAIN_FRAME,
- NetError(net::ERR_NAME_NOT_RESOLVED),
- false, &html);
+ NetError(net::ERR_NAME_NOT_RESOLVED),
+ false, &html);
EXPECT_TRUE(html.empty());
// The blank page loads.
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::ERROR_PAGE);
+ NetErrorHelperCore::ERROR_PAGE);
core()->OnCommitLoad(NetErrorHelperCore::MAIN_FRAME, error_url());
core()->OnFinishLoad(NetErrorHelperCore::MAIN_FRAME);
EXPECT_TRUE(is_url_being_fetched());
@@ -1706,7 +1678,7 @@ TEST_F(NetErrorHelperCoreTest, CorrectionsDisabledDuringFetch) {
// Corrections load.
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::ERROR_PAGE);
+ NetErrorHelperCore::ERROR_PAGE);
core()->OnCommitLoad(NetErrorHelperCore::MAIN_FRAME, error_url());
core()->OnFinishLoad(NetErrorHelperCore::MAIN_FRAME);
EXPECT_EQ(1, error_html_update_count());
@@ -1722,18 +1694,18 @@ TEST_F(NetErrorHelperCoreTest, CorrectionsWithoutSearch) {
// Original page starts loading.
EnableNavigationCorrections();
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::NON_ERROR_PAGE);
+ NetErrorHelperCore::NON_ERROR_PAGE);
// It fails, and corrections are requested.
std::string html;
core()->GetErrorHTML(NetErrorHelperCore::MAIN_FRAME,
- NetError(net::ERR_NAME_NOT_RESOLVED),
- false, &html);
+ NetError(net::ERR_NAME_NOT_RESOLVED),
+ false, &html);
EXPECT_TRUE(html.empty());
// The blank page loads.
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::ERROR_PAGE);
+ NetErrorHelperCore::ERROR_PAGE);
core()->OnCommitLoad(NetErrorHelperCore::MAIN_FRAME, error_url());
core()->OnFinishLoad(NetErrorHelperCore::MAIN_FRAME);
EXPECT_TRUE(is_url_being_fetched());
@@ -1754,7 +1726,7 @@ TEST_F(NetErrorHelperCoreTest, CorrectionsWithoutSearch) {
// Corrections load.
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::ERROR_PAGE);
+ NetErrorHelperCore::ERROR_PAGE);
core()->OnCommitLoad(NetErrorHelperCore::MAIN_FRAME, error_url());
core()->OnFinishLoad(NetErrorHelperCore::MAIN_FRAME);
EXPECT_EQ(1, error_html_update_count());
@@ -1770,18 +1742,18 @@ TEST_F(NetErrorHelperCoreTest, CorrectionsOnlySearchSuggestion) {
// Original page starts loading.
EnableNavigationCorrections();
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::NON_ERROR_PAGE);
+ NetErrorHelperCore::NON_ERROR_PAGE);
// It fails, and corrections are requested.
std::string html;
core()->GetErrorHTML(NetErrorHelperCore::MAIN_FRAME,
- NetError(net::ERR_NAME_NOT_RESOLVED),
- false, &html);
+ NetError(net::ERR_NAME_NOT_RESOLVED),
+ false, &html);
EXPECT_TRUE(html.empty());
// The blank page loads.
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::ERROR_PAGE);
+ NetErrorHelperCore::ERROR_PAGE);
core()->OnCommitLoad(NetErrorHelperCore::MAIN_FRAME, error_url());
core()->OnFinishLoad(NetErrorHelperCore::MAIN_FRAME);
EXPECT_TRUE(is_url_being_fetched());
@@ -1802,7 +1774,7 @@ TEST_F(NetErrorHelperCoreTest, CorrectionsOnlySearchSuggestion) {
// Corrections load.
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::ERROR_PAGE);
+ NetErrorHelperCore::ERROR_PAGE);
core()->OnCommitLoad(NetErrorHelperCore::MAIN_FRAME, error_url());
core()->OnFinishLoad(NetErrorHelperCore::MAIN_FRAME);
EXPECT_EQ(1, error_html_update_count());
@@ -1814,18 +1786,18 @@ TEST_F(NetErrorHelperCoreTest, CorrectionServiceReturnsNonJsonResult) {
// Original page starts loading.
EnableNavigationCorrections();
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::NON_ERROR_PAGE);
+ NetErrorHelperCore::NON_ERROR_PAGE);
// It fails, and corrections are requested.
std::string html;
core()->GetErrorHTML(NetErrorHelperCore::MAIN_FRAME,
- NetError(net::ERR_CONNECTION_FAILED),
- false, &html);
+ NetError(net::ERR_CONNECTION_FAILED),
+ false, &html);
EXPECT_TRUE(html.empty());
// The blank page loads.
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::ERROR_PAGE);
+ NetErrorHelperCore::ERROR_PAGE);
core()->OnCommitLoad(NetErrorHelperCore::MAIN_FRAME, error_url());
core()->OnFinishLoad(NetErrorHelperCore::MAIN_FRAME);
@@ -1840,7 +1812,7 @@ TEST_F(NetErrorHelperCoreTest, CorrectionServiceReturnsNonJsonResult) {
// Error page loads.
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::ERROR_PAGE);
+ NetErrorHelperCore::ERROR_PAGE);
core()->OnCommitLoad(NetErrorHelperCore::MAIN_FRAME, error_url());
core()->OnFinishLoad(NetErrorHelperCore::MAIN_FRAME);
}
@@ -1851,18 +1823,18 @@ TEST_F(NetErrorHelperCoreTest, CorrectionServiceReturnsInvalidJsonResult) {
// Original page starts loading.
EnableNavigationCorrections();
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::NON_ERROR_PAGE);
+ NetErrorHelperCore::NON_ERROR_PAGE);
// It fails, and corrections are requested.
std::string html;
core()->GetErrorHTML(NetErrorHelperCore::MAIN_FRAME,
- NetError(net::ERR_CONNECTION_FAILED),
- false, &html);
+ NetError(net::ERR_CONNECTION_FAILED),
+ false, &html);
EXPECT_TRUE(html.empty());
// The blank page loads.
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::ERROR_PAGE);
+ NetErrorHelperCore::ERROR_PAGE);
core()->OnCommitLoad(NetErrorHelperCore::MAIN_FRAME, error_url());
core()->OnFinishLoad(NetErrorHelperCore::MAIN_FRAME);
@@ -1877,7 +1849,7 @@ TEST_F(NetErrorHelperCoreTest, CorrectionServiceReturnsInvalidJsonResult) {
// Error page loads.
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::ERROR_PAGE);
+ NetErrorHelperCore::ERROR_PAGE);
core()->OnCommitLoad(NetErrorHelperCore::MAIN_FRAME, error_url());
core()->OnFinishLoad(NetErrorHelperCore::MAIN_FRAME);
}
@@ -1888,13 +1860,13 @@ TEST_F(NetErrorHelperCoreTest, CorrectionClickTracking) {
// Original page starts loading.
EnableNavigationCorrections();
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::NON_ERROR_PAGE);
+ NetErrorHelperCore::NON_ERROR_PAGE);
// It fails.
std::string html;
core()->GetErrorHTML(NetErrorHelperCore::MAIN_FRAME,
- NetError(net::ERR_NAME_NOT_RESOLVED),
- false, &html);
+ NetError(net::ERR_NAME_NOT_RESOLVED),
+ false, &html);
EXPECT_TRUE(html.empty());
EXPECT_FALSE(is_url_being_fetched());
EXPECT_FALSE(last_error_page_params());
@@ -1944,15 +1916,15 @@ TEST_F(NetErrorHelperCoreTest, CorrectionClickTracking) {
// Make sure all expected strings appear in output.
EXPECT_TRUE(last_tracking_request_body().find(
- kDefaultCorrections[i].url_correction));
+ kDefaultCorrections[i].url_correction));
EXPECT_TRUE(last_tracking_request_body().find(
- kDefaultCorrections[i].click_data));
+ kDefaultCorrections[i].click_data));
EXPECT_TRUE(last_tracking_request_body().find(
- kDefaultCorrections[i].click_type));
+ kDefaultCorrections[i].click_type));
EXPECT_TRUE(last_tracking_request_body().find(
- kNavigationCorrectionEventId));
+ kNavigationCorrectionEventId));
EXPECT_TRUE(last_tracking_request_body().find(
- kNavigationCorrectionFingerprint));
+ kNavigationCorrectionFingerprint));
}
// Make sure duplicate tracking requests are ignored.
@@ -2039,7 +2011,7 @@ TEST_F(NetErrorHelperCoreAutoReloadTest, StopsOnOtherLoadStart) {
DoErrorLoad(net::ERR_CONNECTION_RESET);
EXPECT_TRUE(timer()->IsRunning());
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::NON_ERROR_PAGE);
+ NetErrorHelperCore::NON_ERROR_PAGE);
EXPECT_FALSE(timer()->IsRunning());
EXPECT_EQ(0, core()->auto_reload_count());
}
@@ -2103,7 +2075,7 @@ TEST_F(NetErrorHelperCoreAutoReloadTest, DoesNotRestartOnOnlineAfterStop) {
TEST_F(NetErrorHelperCoreAutoReloadTest, WithDnsProbes) {
DoErrorLoad(net::ERR_CONNECTION_RESET);
- DoDnsProbe(chrome_common_net::DNS_PROBE_FINISHED_NXDOMAIN);
+ DoDnsProbe(DNS_PROBE_FINISHED_NXDOMAIN);
timer()->Fire();
EXPECT_EQ(1, reload_count());
}
@@ -2126,17 +2098,17 @@ TEST_F(NetErrorHelperCoreAutoReloadTest, ExponentialBackoffLevelsOff) {
TEST_F(NetErrorHelperCoreAutoReloadTest, SlowError) {
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::NON_ERROR_PAGE);
+ NetErrorHelperCore::NON_ERROR_PAGE);
std::string html;
core()->GetErrorHTML(NetErrorHelperCore::MAIN_FRAME,
- NetError(net::ERR_CONNECTION_RESET), false, &html);
+ NetError(net::ERR_CONNECTION_RESET), false, &html);
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::ERROR_PAGE);
+ NetErrorHelperCore::ERROR_PAGE);
core()->OnCommitLoad(NetErrorHelperCore::MAIN_FRAME, error_url());
EXPECT_FALSE(timer()->IsRunning());
// Start a new non-error page load.
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::NON_ERROR_PAGE);
+ NetErrorHelperCore::NON_ERROR_PAGE);
EXPECT_FALSE(timer()->IsRunning());
// Finish the error page load.
core()->OnFinishLoad(NetErrorHelperCore::MAIN_FRAME);
@@ -2149,12 +2121,12 @@ TEST_F(NetErrorHelperCoreAutoReloadTest, SlowError) {
TEST_F(NetErrorHelperCoreAutoReloadTest, OnlineSlowError) {
core()->NetworkStateChanged(false);
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::NON_ERROR_PAGE);
+ NetErrorHelperCore::NON_ERROR_PAGE);
std::string html;
core()->GetErrorHTML(NetErrorHelperCore::MAIN_FRAME,
- NetError(net::ERR_CONNECTION_RESET), false, &html);
+ NetError(net::ERR_CONNECTION_RESET), false, &html);
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::ERROR_PAGE);
+ NetErrorHelperCore::ERROR_PAGE);
core()->OnCommitLoad(NetErrorHelperCore::MAIN_FRAME, error_url());
EXPECT_FALSE(timer()->IsRunning());
core()->NetworkStateChanged(true);
@@ -2169,12 +2141,12 @@ TEST_F(NetErrorHelperCoreAutoReloadTest, OnlineSlowError) {
TEST_F(NetErrorHelperCoreAutoReloadTest, OnlinePendingError) {
core()->NetworkStateChanged(false);
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::NON_ERROR_PAGE);
+ NetErrorHelperCore::NON_ERROR_PAGE);
std::string html;
core()->GetErrorHTML(NetErrorHelperCore::MAIN_FRAME,
- NetError(net::ERR_CONNECTION_RESET), false, &html);
+ NetError(net::ERR_CONNECTION_RESET), false, &html);
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::ERROR_PAGE);
+ NetErrorHelperCore::ERROR_PAGE);
EXPECT_FALSE(timer()->IsRunning());
core()->NetworkStateChanged(true);
EXPECT_FALSE(timer()->IsRunning());
@@ -2189,20 +2161,20 @@ TEST_F(NetErrorHelperCoreAutoReloadTest, OnlinePendingError) {
TEST_F(NetErrorHelperCoreAutoReloadTest, OnlinePartialErrorReplacement) {
core()->NetworkStateChanged(false);
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::NON_ERROR_PAGE);
+ NetErrorHelperCore::NON_ERROR_PAGE);
std::string html;
core()->GetErrorHTML(NetErrorHelperCore::MAIN_FRAME,
- NetError(net::ERR_CONNECTION_RESET), false, &html);
+ NetError(net::ERR_CONNECTION_RESET), false, &html);
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::ERROR_PAGE);
+ NetErrorHelperCore::ERROR_PAGE);
core()->OnCommitLoad(NetErrorHelperCore::MAIN_FRAME, error_url());
core()->OnFinishLoad(NetErrorHelperCore::MAIN_FRAME);
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::NON_ERROR_PAGE);
+ NetErrorHelperCore::NON_ERROR_PAGE);
core()->GetErrorHTML(NetErrorHelperCore::MAIN_FRAME,
- NetError(net::ERR_CONNECTION_RESET), false, &html);
+ NetError(net::ERR_CONNECTION_RESET), false, &html);
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::ERROR_PAGE);
+ NetErrorHelperCore::ERROR_PAGE);
EXPECT_FALSE(timer()->IsRunning());
core()->NetworkStateChanged(true);
EXPECT_FALSE(timer()->IsRunning());
@@ -2246,7 +2218,7 @@ TEST_F(NetErrorHelperCoreAutoReloadTest, ShouldSuppressErrorPage) {
// Sub-frame load.
EXPECT_FALSE(core()->ShouldSuppressErrorPage(NetErrorHelperCore::SUB_FRAME,
- GURL(kFailedUrl)));
+ GURL(kFailedUrl)));
EXPECT_TRUE(core()->ShouldSuppressErrorPage(NetErrorHelperCore::MAIN_FRAME,
GURL(kFailedUrl)));
// No auto-reload attempt in flight.
@@ -2352,7 +2324,7 @@ TEST_F(NetErrorHelperCoreHistogramTest, SuccessAtSecondAttempt) {
DoErrorLoad(net::ERR_CONNECTION_RESET);
timer()->Fire();
EXPECT_TRUE(core()->ShouldSuppressErrorPage(NetErrorHelperCore::MAIN_FRAME,
- default_url()));
+ default_url()));
timer()->Fire();
DoSuccessLoad();
@@ -2373,7 +2345,7 @@ TEST_F(NetErrorHelperCoreHistogramTest, UserStop) {
DoErrorLoad(net::ERR_CONNECTION_RESET);
timer()->Fire();
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::NON_ERROR_PAGE);
+ NetErrorHelperCore::NON_ERROR_PAGE);
core()->OnStop();
// CountAtStop and ErrorAtStop should reflect the failure.
@@ -2392,7 +2364,7 @@ TEST_F(NetErrorHelperCoreHistogramTest, UserStop) {
TEST_F(NetErrorHelperCoreHistogramTest, OtherPageLoaded) {
DoErrorLoad(net::ERR_CONNECTION_RESET);
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::NON_ERROR_PAGE);
+ NetErrorHelperCore::NON_ERROR_PAGE);
core()->OnStop();
histogram_tester_.ExpectTotalCount(kCountAtSuccess, 0);
@@ -2410,9 +2382,9 @@ TEST_F(NetErrorHelperCoreHistogramTest, OtherPageLoadedAfterTimerFires) {
DoErrorLoad(net::ERR_CONNECTION_RESET);
timer()->Fire();
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::NON_ERROR_PAGE);
+ NetErrorHelperCore::NON_ERROR_PAGE);
core()->OnCommitLoad(NetErrorHelperCore::MAIN_FRAME,
- kTestUrl);
+ kTestUrl);
core()->OnFinishLoad(NetErrorHelperCore::MAIN_FRAME);
histogram_tester_.ExpectTotalCount(kCountAtSuccess, 0);
@@ -2441,7 +2413,7 @@ TEST_F(NetErrorHelperCoreHistogramTest, SamePageLoadedAfterLoadStarts) {
timer()->Fire();
// Autoreload attempt starts
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::NON_ERROR_PAGE);
+ NetErrorHelperCore::NON_ERROR_PAGE);
// User does a manual reload
DoSuccessLoad();
@@ -2458,9 +2430,9 @@ TEST_F(NetErrorHelperCoreHistogramTest, ErrorPageLoadedAfterTimerFires) {
DoErrorLoad(net::ERR_CONNECTION_RESET);
timer()->Fire();
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::NON_ERROR_PAGE);
+ NetErrorHelperCore::NON_ERROR_PAGE);
EXPECT_TRUE(core()->ShouldSuppressErrorPage(NetErrorHelperCore::MAIN_FRAME,
- default_url()));
+ default_url()));
DoErrorLoad(net::ERR_CONNECTION_RESET);
histogram_tester_.ExpectTotalCount(kCountAtSuccess, 0);
@@ -2473,9 +2445,9 @@ TEST_F(NetErrorHelperCoreHistogramTest, ErrorPageLoadedAfterTimerFires) {
TEST_F(NetErrorHelperCoreHistogramTest, SuccessPageLoadedBeforeTimerFires) {
DoErrorLoad(net::ERR_CONNECTION_RESET);
core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME,
- NetErrorHelperCore::NON_ERROR_PAGE);
+ NetErrorHelperCore::NON_ERROR_PAGE);
core()->OnCommitLoad(NetErrorHelperCore::MAIN_FRAME,
- GURL(kFailedHttpsUrl));
+ GURL(kFailedHttpsUrl));
histogram_tester_.ExpectTotalCount(kCountAtSuccess, 0);
histogram_tester_.ExpectTotalCount(kErrorAtSuccess, 0);