Commit ca750be7 authored by Mike Dougherty's avatar Mike Dougherty Committed by Commit Bot

Remove unused web::test::HttpServer util functions

Bug: 694859, 891834
Change-Id: I32703be2378b43235cd2343c36946fe9cbb45a34
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2375800Reviewed-by: default avatarEugene But <eugenebut@chromium.org>
Commit-Queue: Eugene But <eugenebut@chromium.org>
Auto-Submit: Mike Dougherty <michaeldo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#801606}
parent c30fd575
......@@ -74,7 +74,6 @@ void AssertElementIsFocused(const std::string& element_id) {
EARL_GREY_TEST_SKIPPED(@"Skipped for iPad (no hidden toolbar in tablet)");
}
web::test::SetUpFileBasedHttpServer();
GURL URL = web::test::HttpServer::MakeUrl(
"http://ios/testing/data/http_server_files/multi_field_form.html");
[ChromeEarlGrey loadURL:URL];
......
......@@ -47,13 +47,6 @@ void AssertHandoffURL(const GURL& gurl) {
@implementation HandoffManagerTestCase
#pragma mark - Overrides base class
- (void)setUp {
[super setUp];
web::test::SetUpFileBasedHttpServer();
}
#pragma mark - Tests
// Tests that an empty new tab page should result in no Handoff URL.
......
......@@ -160,7 +160,6 @@ void SwitchToNormalMode() {
// Tests that the recorder actual recorde tab state.
// TODO(crbug.com/934228) The test is flaky.
- (void)DISABLED_testTabSwitchRecorder {
web::test::SetUpFileBasedHttpServer();
[ChromeEarlGrey resetTabUsageRecorder];
// Open two tabs with urls.
......@@ -217,7 +216,6 @@ void SwitchToNormalMode() {
// Verifies the UMA metric for page loads before a tab eviction by loading
// some tabs, forcing a tab eviction, then checking the histogram.
- (void)testPageLoadCountBeforeEvictedTab {
web::test::SetUpFileBasedHttpServer();
[ChromeEarlGrey resetTabUsageRecorder];
const GURL url1 = web::test::HttpServer::MakeUrl(kTestUrl1);
// This test opens three tabs.
......@@ -291,7 +289,6 @@ void SwitchToNormalMode() {
// EVICTED_DUE_TO_COLD_START.
// TODO(crbug.com/934228) The test is disabled due to flakiness.
- (void)DISABLED_testColdLaunchReloadCount {
web::test::SetUpFileBasedHttpServer();
[ChromeEarlGrey resetTabUsageRecorder];
// Open two tabs with urls.
......@@ -362,7 +359,6 @@ void SwitchToNormalMode() {
// Tests that tabs reloads after backgrounding and eviction.
// TODO(crbug.com/934228) The test is flaky.
- (void)DISABLED_testBackgroundingReloadCount {
web::test::SetUpFileBasedHttpServer();
[ChromeEarlGrey resetTabUsageRecorder];
// Open two tabs with urls.
......@@ -427,8 +423,6 @@ void SwitchToNormalMode() {
// succeeds.
// TODO(crbug.com/934228) The test is flaky.
- (void)DISABLED_testEvictedTabReloadSuccess {
web::test::SetUpFileBasedHttpServer();
[ChromeEarlGrey closeAllTabsInCurrentMode];
GURL URL = web::test::HttpServer::MakeUrl(kTestUrl1);
NewMainTabWithURL(URL, kURL1FirstWord);
......@@ -726,7 +720,6 @@ void SwitchToNormalMode() {
"http://ios/testing/data/http_server_files/redirect_refresh.html");
GURL destinationURL = web::test::HttpServer::MakeUrl(
"http://ios/testing/data/http_server_files/destination.html");
web::test::SetUpFileBasedHttpServer();
[ChromeEarlGrey resetTabUsageRecorder];
NewMainTabWithURL(redirectURL, "arrived");
......@@ -877,7 +870,6 @@ void SwitchToNormalMode() {
// Tests that opening tabs from external app will not cause tab eviction.
- (void)testOpenFromApp {
web::test::SetUpFileBasedHttpServer();
[ChromeEarlGrey resetTabUsageRecorder];
[ChromeEarlGrey openNewTab];
......@@ -906,7 +898,6 @@ void SwitchToNormalMode() {
// Verify that evicted tabs that are deleted are removed from the evicted tabs
// map.
- (void)testTabDeletion {
web::test::SetUpFileBasedHttpServer();
[ChromeEarlGrey resetTabUsageRecorder];
// Add an autorelease pool to delete the closed tabs before the end of the
// test.
......
......@@ -97,7 +97,6 @@ void WaitforPDFExtensionView() {
// TODO(crbug.com/947536): Fails on iOS 12 devices.
// TODO(crbug.com/1106997): Test fails in simulator builders.
- (void)DISABLED_testLongPDFInitialState {
web::test::SetUpFileBasedHttpServer();
GURL URL = web::test::HttpServer::MakeUrl(
"http://ios/testing/data/http_server_files/two_pages.pdf");
[ChromeEarlGrey loadURL:URL];
......@@ -127,7 +126,6 @@ void WaitforPDFExtensionView() {
}
#endif
web::test::SetUpFileBasedHttpServer();
GURL URL = web::test::HttpServer::MakeUrl(
"http://ios/testing/data/http_server_files/single_page_wide.pdf");
[ChromeEarlGrey loadURL:URL];
......@@ -161,7 +159,6 @@ void WaitforPDFExtensionView() {
#define MAYBE_testLongPDFScroll testLongPDFScroll
#endif
- (void)MAYBE_testLongPDFScroll {
web::test::SetUpFileBasedHttpServer();
GURL URL = web::test::HttpServer::MakeUrl(
"http://ios/testing/data/http_server_files/two_pages.pdf");
[ChromeEarlGrey loadURL:URL];
......
......@@ -165,7 +165,6 @@ const char kPDFURL[] = "http://ios/testing/data/http_server_files/testpage.pdf";
EARL_GREY_TEST_DISABLED(@"EG1 flaky on iOS 12.");
}
#endif
web::test::SetUpFileBasedHttpServer();
const GURL URL = web::test::HttpServer::MakeUrl(kPDFURL);
// Navigate to a mock pdf and verify that the find button is disabled.
......
......@@ -415,7 +415,6 @@ class UserAgentResponseProvider : public web::DataResponseProvider {
//
// Disabled due to flakiness: https://crbug.com/1111194.
- (void)DISABLED_testAppVersionJSAPIWithMobileUserAgent {
web::test::SetUpFileBasedHttpServer();
[ChromeEarlGrey loadURL:web::test::HttpServer::MakeUrl(kUserAgentTestURL)];
// Verify initial reception of the mobile site.
[ChromeEarlGrey waitForWebStateContainingText:[self defaultLabel]];
......
......@@ -70,7 +70,6 @@ id<GREYMatcher> incognitoHelpContainsText() {
EARL_GREY_TEST_DISABLED(@"Fails on iOS 13.");
}
// Prepare a simple but known URL to avoid testing from the NTP.
web::test::SetUpFileBasedHttpServer();
const GURL simple_URL = web::test::HttpServer::MakeUrl(
"http://ios/testing/data/http_server_files/destination.html");
......
......@@ -36,7 +36,6 @@ using chrome_test_util::SystemSelectionCalloutCopyButton;
// Verifies that entering a URL in the omnibox navigates to the correct URL and
// displays content.
- (void)testEnterURL {
web::test::SetUpFileBasedHttpServer();
const GURL URL = web::test::HttpServer::MakeUrl(
"http://ios/testing/data/http_server_files/destination.html");
[ChromeEarlGrey loadURL:URL];
......
......@@ -110,8 +110,6 @@ id<GREYMatcher> TabWithTitle(const std::string& tab_title) {
EARL_GREY_TEST_SKIPPED(@"Tab Title not displayed on handset.");
}
web::test::SetUpFileBasedHttpServer();
const GURL destinationURL = web::test::HttpServer::MakeUrl(
"http://ios/testing/data/http_server_files/destination.html");
[ChromeEarlGrey loadURL:destinationURL];
......@@ -130,8 +128,6 @@ id<GREYMatcher> TabWithTitle(const std::string& tab_title) {
EARL_GREY_TEST_SKIPPED(@"Tab Title not displayed on handset.");
}
web::test::SetUpFileBasedHttpServer();
const GURL destinationURL = web::test::HttpServer::MakeUrl(
"http://ios/testing/data/http_server_files/testpage.pdf");
[ChromeEarlGrey loadURL:destinationURL];
......
......@@ -42,7 +42,6 @@ GURL GetTestUrl() {
// Disable popup blocking, because that will mask failures that try to open
// new tabs.
ScopedBlockPopupsPref scoper(CONTENT_SETTING_ALLOW);
web::test::SetUpFileBasedHttpServer();
const GURL testURL = GetTestUrl();
[ChromeEarlGrey loadURL:testURL];
......@@ -81,7 +80,6 @@ GURL GetTestUrl() {
// Disable popup blocking, because that will mask failures that try to open
// new tabs.
ScopedBlockPopupsPref scoper(CONTENT_SETTING_ALLOW);
web::test::SetUpFileBasedHttpServer();
const GURL testURL = GetTestUrl();
[ChromeEarlGrey loadURL:testURL];
......
......@@ -86,7 +86,6 @@ std::unique_ptr<net::test_server::HttpResponse> WriteReloadHandler(
+ (void)setUpHelper {
[ChromeEarlGrey setContentSettings:CONTENT_SETTING_ALLOW];
web::test::SetUpFileBasedHttpServer();
}
+ (void)tearDown {
......
......@@ -58,7 +58,6 @@ const char* kReplaceStateRootPathSpaceURL = "http://ios/rep lace";
web::test::HttpServer::MakeUrl("http://ios/pa%20th");
const std::string pushStatePathSpaceOmniboxText =
net::GetContentAndFragmentForUrl(pushStatePathSpaceURL);
web::test::SetUpFileBasedHttpServer();
[ChromeEarlGrey loadURL:web::test::HttpServer::MakeUrl(kHistoryTestUrl)];
// Push 3 URLs. Verify that the URL changed and the status was updated.
......@@ -98,7 +97,6 @@ const char* kReplaceStateRootPathSpaceURL = "http://ios/rep lace";
// Tests that calling replaceState() changes the current history entry.
- (void)testHtml5HistoryReplaceStateThenGoBackAndForward {
web::test::SetUpFileBasedHttpServer();
const GURL initialURL = web::test::HttpServer::MakeUrl(kNonPushedUrl);
const std::string initialOmniboxText =
net::GetContentAndFragmentForUrl(initialURL);
......@@ -187,7 +185,6 @@ const char* kReplaceStateRootPathSpaceURL = "http://ios/rep lace";
const std::string replaceStateThenPushStateOmniboxText =
net::GetContentAndFragmentForUrl(replaceStateThenPushStateURL);
web::test::SetUpFileBasedHttpServer();
[ChromeEarlGrey loadURL:web::test::HttpServer::MakeUrl(kHistoryTestUrl)];
// Replace state and then push state. Verify that at the end, the URL changed
......@@ -221,8 +218,6 @@ const char* kReplaceStateRootPathSpaceURL = "http://ios/rep lace";
const std::string pushStateThenReplaceStateOmniboxText =
net::GetContentAndFragmentForUrl(pushStateThenReplaceStateURL);
web::test::SetUpFileBasedHttpServer();
const GURL historyTestURL = web::test::HttpServer::MakeUrl(kHistoryTestUrl);
[ChromeEarlGrey loadURL:historyTestURL];
const std::string historyTestOmniboxText =
......@@ -248,7 +243,6 @@ const char* kReplaceStateRootPathSpaceURL = "http://ios/rep lace";
// Tests that page loads occur when navigating to or past a non-pushed URL.
- (void)testHtml5HistoryNavigatingPastNonPushedURL {
GURL nonPushedURL = web::test::HttpServer::MakeUrl(kNonPushedUrl);
web::test::SetUpFileBasedHttpServer();
const GURL historyTestURL = web::test::HttpServer::MakeUrl(kHistoryTestUrl);
[ChromeEarlGrey loadURL:historyTestURL];
const std::string historyTestOmniboxText =
......@@ -324,7 +318,6 @@ const char* kReplaceStateRootPathSpaceURL = "http://ios/rep lace";
const char pushStateUnicode2Label[] = "Action: pushStateUnicode2∢";
NSString* pushStateUnicode2Status = @"pushStateUnicode2∢";
web::test::SetUpFileBasedHttpServer();
[ChromeEarlGrey loadURL:web::test::HttpServer::MakeUrl(kHistoryTestUrl)];
// Do 2 push states with unicode characters.
......
......@@ -66,9 +66,6 @@ class HistoryStateOperationsTest : public web::WebIntTest {
void SetUp() override {
web::WebIntTest::SetUp();
// History state tests use file-based test pages.
web::test::SetUpFileBasedHttpServer();
// Load the history state test page.
state_operations_url_ =
web::test::HttpServer::MakeUrl(kHistoryStateOperationsTestUrl);
......
......@@ -62,9 +62,6 @@ class WindowLocationTest : public web::WebIntTest {
void SetUp() override {
web::WebIntTest::SetUp();
// window.location tests use file-based test pages.
web::test::SetUpFileBasedHttpServer();
// Load the window.location test page.
window_location_url_ =
web::test::HttpServer::MakeUrl(kWindowLocationTestURL);
......
......@@ -19,20 +19,6 @@ namespace test {
// HtmlResponseProvider will use the |responses| map to resolve URLs.
void SetUpSimpleHttpServer(const std::map<GURL, std::string>& responses);
// Sets up a web::test::HttpServer with a simple HtmlResponseProvider. The
// HtmlResponseProvider will use the |responses| map to resolve URLs. The value
// of |responses| is the cookie and response body pair where the first string is
// the cookie and the second string is the response body. Set the cookie string
// as empty string if cookie is not needed in the response headers.
void SetUpSimpleHttpServerWithSetCookies(
const std::map<GURL, std::pair<std::string, std::string>>& responses);
// Sets up a web::test::HttpServer with a FileBasedResponseProvider. The
// server will try to resolve URLs as file paths relative to the application
// bundle path. web::test::MakeUrl should be used to rewrite URLs before doing
// a request.
void SetUpFileBasedHttpServer();
// Sets up a web::test::HttpServer with a single custom provider.
// Takes ownership of the provider.
void SetUpHttpServer(std::unique_ptr<web::ResponseProvider> provider);
......
......@@ -21,15 +21,6 @@ void SetUpSimpleHttpServer(const std::map<GURL, std::string>& responses) {
SetUpHttpServer(std::make_unique<HtmlResponseProvider>(responses));
}
void SetUpSimpleHttpServerWithSetCookies(
const std::map<GURL, std::pair<std::string, std::string>>& responses) {
SetUpHttpServer(std::make_unique<HtmlResponseProvider>(responses));
}
// TODO(crbug.com/694859): Cleanup tests and remove the function. Not
// necessary after switching to EmbeddedTestServer.
void SetUpFileBasedHttpServer() {}
void SetUpHttpServer(std::unique_ptr<web::ResponseProvider> provider) {
web::test::HttpServer& server = web::test::HttpServer::GetSharedInstance();
DCHECK(server.IsRunning());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment