OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/files/file_path.h" | 5 #include "base/files/file_path.h" |
6 #include "base/path_service.h" | 6 #include "base/path_service.h" |
7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
8 #include "chrome/browser/browsing_data/browsing_data_helper.h" | 8 #include "chrome/browser/browsing_data/browsing_data_helper.h" |
9 #include "chrome/browser/browsing_data/browsing_data_remover.h" | 9 #include "chrome/browser/browsing_data/browsing_data_remover.h" |
10 #include "chrome/browser/browsing_data/browsing_data_remover_test_util.h" | 10 #include "chrome/browser/browsing_data/browsing_data_remover_test_util.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 void SetUrlRequestMock(const base::FilePath& path) { | 31 void SetUrlRequestMock(const base::FilePath& path) { |
32 net::URLRequestMockHTTPJob::AddUrlHandler(path, | 32 net::URLRequestMockHTTPJob::AddUrlHandler(path, |
33 BrowserThread::GetBlockingPool()); | 33 BrowserThread::GetBlockingPool()); |
34 } | 34 } |
35 } | 35 } |
36 | 36 |
37 class BrowsingDataRemoverBrowserTest : public InProcessBrowserTest { | 37 class BrowsingDataRemoverBrowserTest : public InProcessBrowserTest { |
38 public: | 38 public: |
39 BrowsingDataRemoverBrowserTest() {} | 39 BrowsingDataRemoverBrowserTest() {} |
40 | 40 |
41 virtual void SetUpOnMainThread() OVERRIDE { | 41 virtual void SetUpOnMainThread() override { |
42 base::FilePath path; | 42 base::FilePath path; |
43 PathService::Get(content::DIR_TEST_DATA, &path); | 43 PathService::Get(content::DIR_TEST_DATA, &path); |
44 BrowserThread::PostTask( | 44 BrowserThread::PostTask( |
45 BrowserThread::IO, FROM_HERE, base::Bind(&SetUrlRequestMock, path)); | 45 BrowserThread::IO, FROM_HERE, base::Bind(&SetUrlRequestMock, path)); |
46 } | 46 } |
47 | 47 |
48 void RunScriptAndCheckResult(const std::string& script, | 48 void RunScriptAndCheckResult(const std::string& script, |
49 const std::string& result) { | 49 const std::string& result) { |
50 std::string data; | 50 std::string data; |
51 ASSERT_TRUE(content::ExecuteScriptAndExtractString( | 51 ASSERT_TRUE(content::ExecuteScriptAndExtractString( |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 ui_test_utils::NavigateToURL(browser(), url); | 130 ui_test_utils::NavigateToURL(browser(), url); |
131 RunScriptAndCheckResult("createTable()", "done"); | 131 RunScriptAndCheckResult("createTable()", "done"); |
132 RunScriptAndCheckResult("insertRecord('text2')", "done"); | 132 RunScriptAndCheckResult("insertRecord('text2')", "done"); |
133 RunScriptAndCheckResult("getRecords()", "text2"); | 133 RunScriptAndCheckResult("getRecords()", "text2"); |
134 } | 134 } |
135 | 135 |
136 // Profile::ClearNetworkingHistorySince should be exercised here too see whether | 136 // Profile::ClearNetworkingHistorySince should be exercised here too see whether |
137 // the call gets delegated through ProfileIO[Impl]Data properly, which is hard | 137 // the call gets delegated through ProfileIO[Impl]Data properly, which is hard |
138 // to write unit-tests for. Currently this is done by both of the above tests. | 138 // to write unit-tests for. Currently this is done by both of the above tests. |
139 // Add standalone test if this changes. | 139 // Add standalone test if this changes. |
OLD | NEW |