diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-22 21:44:07 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-22 21:44:07 +0000 |
commit | 81702c8c3ee565331fc6b87dbb4ee1983fe5cb69 (patch) | |
tree | 3865f033be7f61d11ea13501bd393fb34f565b5d /chrome/browser/browsing_data | |
parent | d8578f5fab11238d3fc07ac53bad6e38796fa802 (diff) | |
download | chromium_src-81702c8c3ee565331fc6b87dbb4ee1983fe5cb69.zip chromium_src-81702c8c3ee565331fc6b87dbb4ee1983fe5cb69.tar.gz chromium_src-81702c8c3ee565331fc6b87dbb4ee1983fe5cb69.tar.bz2 |
Convert the Web SQL Database pyauto test to content_browsertests.
BUG=143637
Review URL: https://chromiumcodereview.appspot.com/10879018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@152821 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browsing_data')
-rw-r--r-- | chrome/browser/browsing_data/browsing_data_remover_browsertest.cc | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/chrome/browser/browsing_data/browsing_data_remover_browsertest.cc b/chrome/browser/browsing_data/browsing_data_remover_browsertest.cc index dfc093c..e89a214 100644 --- a/chrome/browser/browsing_data/browsing_data_remover_browsertest.cc +++ b/chrome/browser/browsing_data/browsing_data_remover_browsertest.cc @@ -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/prefs/pref_service.h" @@ -13,17 +15,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; @@ -79,8 +98,8 @@ IN_PROC_BROWSER_TEST_F(BrowsingDataRemoverBrowserTest, Download) { // 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"); |