Chromium Code Reviews| 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..438888872910f896c0679cb53133946fe90688d0 100644 |
| --- a/chrome/browser/history/history_browsertest.cc |
| +++ b/chrome/browser/history/history_browsertest.cc |
| @@ -25,12 +25,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[] = |
|
erikwright (departed)
2015/03/30 14:22:30
include base/files/file_path.h
|
| + 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 +64,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 +114,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). |