Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(387)

Unified Diff: chrome/browser/history/history_browsertest.cc

Issue 976553002: Remove the '--enable-file-cookies' flag. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nits. Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/browsing_data/browsing_data_helper.cc ('k') | chrome/test/ppapi/ppapi_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/history/history_browsertest.cc
diff --git a/chrome/browser/history/history_browsertest.cc b/chrome/browser/history/history_browsertest.cc
index 00b28c6d6d8e6f43c5e0c9bb2efdf453e1459f6d..13d9b00ab581d5ae1ac67bbe2314b7102ce0ac97 100644
--- a/chrome/browser/history/history_browsertest.cc
+++ b/chrome/browser/history/history_browsertest.cc
@@ -6,6 +6,7 @@
#include "base/bind.h"
#include "base/command_line.h"
+#include "base/files/file_path.h"
#include "base/message_loop/message_loop.h"
#include "base/prefs/pref_service.h"
#include "base/strings/utf_string_conversions.h"
@@ -25,12 +26,16 @@
#include "content/public/browser/web_contents.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/test_browser_thread.h"
+#include "net/test/spawned_test_server/spawned_test_server.h"
#include "url/gurl.h"
using content::BrowserThread;
namespace {
+const base::FilePath::CharType kDocRoot[] =
+ FILE_PATH_LITERAL("chrome/test/data");
+
// Note: WaitableEvent is not used for synchronization between the main thread
// and history backend thread because the history subsystem posts tasks back
// to the main thread. Had we tried to Signal an event in such a task
@@ -60,9 +65,12 @@ class WaitForHistoryTask : public history::HistoryDBTask {
class HistoryBrowserTest : public InProcessBrowserTest {
protected:
- void SetUpCommandLine(base::CommandLine* command_line) override {
- command_line->AppendSwitch(switches::kEnableFileCookies);
- }
+ HistoryBrowserTest()
+ : test_server_(net::SpawnedTestServer::TYPE_HTTP,
+ net::SpawnedTestServer::kLocalhost,
+ base::FilePath(kDocRoot)) {}
+
+ void SetUp() override { ASSERT_TRUE(test_server_.Start()); }
PrefService* GetPrefs() {
return GetProfile()->GetPrefs();
@@ -107,11 +115,11 @@ class HistoryBrowserTest : public InProcessBrowserTest {
}
void LoadAndWaitForFile(const char* filename) {
- GURL url = ui_test_utils::GetTestUrl(
- base::FilePath().AppendASCII("History"),
- base::FilePath().AppendASCII(filename));
+ GURL url = test_server_.GetURL(std::string("History") + filename);
LoadAndWaitForURL(url);
}
+
+ net::SpawnedTestServer test_server_;
};
// Test that the browser history is saved (default setting).
« no previous file with comments | « chrome/browser/browsing_data/browsing_data_helper.cc ('k') | chrome/test/ppapi/ppapi_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698