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

Unified Diff: chrome/browser/browsing_data/browsing_data_remover_browsertest.cc

Issue 10879018: Convert the Web SQL Database pyauto test to content_browsertests. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 4 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 | « no previous file | chrome/test/data/database/database_tester.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browsing_data/browsing_data_remover_browsertest.cc
===================================================================
--- chrome/browser/browsing_data/browsing_data_remover_browsertest.cc (revision 152782)
+++ chrome/browser/browsing_data/browsing_data_remover_browsertest.cc (working copy)
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/file_path.h"
+#include "base/path_service.h"
#include "chrome/browser/browsing_data/browsing_data_helper.h"
#include "chrome/browser/browsing_data/browsing_data_remover.h"
#include "chrome/browser/profiles/profile.h"
@@ -11,17 +13,34 @@
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
#include "content/public/browser/browser_context.h"
+#include "content/public/browser/browser_thread.h"
#include "content/public/browser/download_manager.h"
#include "content/public/browser/web_contents.h"
+#include "content/public/common/content_paths.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/download_test_observer.h"
#include "content/test/net/url_request_mock_http_job.h"
#include "testing/gtest/include/gtest/gtest.h"
+using content::BrowserThread;
+
+namespace {
+void SetUrlRequestMock(const FilePath& path) {
+ URLRequestMockHTTPJob::AddUrlHandler(path);
+}
+}
+
class BrowsingDataRemoverBrowserTest : public InProcessBrowserTest {
public:
BrowsingDataRemoverBrowserTest() {}
+ virtual void SetUpOnMainThread() OVERRIDE {
+ FilePath path;
+ PathService::Get(content::DIR_TEST_DATA, &path);
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE, base::Bind(&SetUrlRequestMock, path));
+ }
+
void RunScriptAndCheckResult(const std::wstring& script,
const std::string& result) {
std::string data;
@@ -72,8 +91,8 @@
// Verify can modify database after deleting it.
IN_PROC_BROWSER_TEST_F(BrowsingDataRemoverBrowserTest, Database) {
- ASSERT_TRUE(test_server()->Start());
- GURL url = test_server()->GetURL("files/database/simple_database.html");
+ GURL url(URLRequestMockHTTPJob::GetMockUrl(
+ FilePath().AppendASCII("simple_database.html")));
ui_test_utils::NavigateToURL(browser(), url);
RunScriptAndCheckResult(L"createTable()", "done");
« no previous file with comments | « no previous file | chrome/test/data/database/database_tester.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698