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/file_path.h" | 5 #include "base/file_path.h" |
6 #include "base/path_service.h" | 6 #include "base/path_service.h" |
7 #include "chrome/browser/browsing_data/browsing_data_helper.h" | 7 #include "chrome/browser/browsing_data/browsing_data_helper.h" |
8 #include "chrome/browser/browsing_data/browsing_data_remover.h" | 8 #include "chrome/browser/browsing_data/browsing_data_remover.h" |
9 #include "chrome/browser/prefs/pref_service.h" | 9 #include "chrome/browser/prefs/pref_service.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 content::Source<Profile>(browser()->profile())); | 58 content::Source<Profile>(browser()->profile())); |
59 BrowsingDataRemover* remover = BrowsingDataRemover::CreateForPeriod( | 59 BrowsingDataRemover* remover = BrowsingDataRemover::CreateForPeriod( |
60 browser()->profile(), BrowsingDataRemover::LAST_HOUR); | 60 browser()->profile(), BrowsingDataRemover::LAST_HOUR); |
61 remover->Remove(remove_mask, BrowsingDataHelper::UNPROTECTED_WEB); | 61 remover->Remove(remove_mask, BrowsingDataHelper::UNPROTECTED_WEB); |
62 signal.Wait(); | 62 signal.Wait(); |
63 } | 63 } |
64 }; | 64 }; |
65 | 65 |
66 // Test BrowsingDataRemover for downloads. | 66 // Test BrowsingDataRemover for downloads. |
67 IN_PROC_BROWSER_TEST_F(BrowsingDataRemoverBrowserTest, Download) { | 67 IN_PROC_BROWSER_TEST_F(BrowsingDataRemoverBrowserTest, Download) { |
68 ScopedTempDir downloads_directory; | 68 base::ScopedTempDir downloads_directory; |
69 ASSERT_TRUE(downloads_directory.CreateUniqueTempDir()); | 69 ASSERT_TRUE(downloads_directory.CreateUniqueTempDir()); |
70 browser()->profile()->GetPrefs()->SetFilePath( | 70 browser()->profile()->GetPrefs()->SetFilePath( |
71 prefs::kDownloadDefaultDirectory, downloads_directory.path()); | 71 prefs::kDownloadDefaultDirectory, downloads_directory.path()); |
72 | 72 |
73 // Start a download. | 73 // Start a download. |
74 content::DownloadManager* download_manager = | 74 content::DownloadManager* download_manager = |
75 content::BrowserContext::GetDownloadManager(browser()->profile()); | 75 content::BrowserContext::GetDownloadManager(browser()->profile()); |
76 scoped_ptr<content::DownloadTestObserver> observer( | 76 scoped_ptr<content::DownloadTestObserver> observer( |
77 new content::DownloadTestObserverTerminal( | 77 new content::DownloadTestObserverTerminal( |
78 download_manager, 1, | 78 download_manager, 1, |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 ui_test_utils::NavigateToURL(browser(), url); | 110 ui_test_utils::NavigateToURL(browser(), url); |
111 RunScriptAndCheckResult(L"createTable()", "done"); | 111 RunScriptAndCheckResult(L"createTable()", "done"); |
112 RunScriptAndCheckResult(L"insertRecord('text2')", "done"); | 112 RunScriptAndCheckResult(L"insertRecord('text2')", "done"); |
113 RunScriptAndCheckResult(L"getRecords()", "text2"); | 113 RunScriptAndCheckResult(L"getRecords()", "text2"); |
114 } | 114 } |
115 | 115 |
116 // Profile::ClearNetworkingHistorySince should be exercised here too see whether | 116 // Profile::ClearNetworkingHistorySince should be exercised here too see whether |
117 // the call gets delegated through ProfileIO[Impl]Data properly, which is hard | 117 // the call gets delegated through ProfileIO[Impl]Data properly, which is hard |
118 // to write unit-tests for. Currently this is done by both of the above tests. | 118 // to write unit-tests for. Currently this is done by both of the above tests. |
119 // Add standalone test if this changes. | 119 // Add standalone test if this changes. |
OLD | NEW |