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/at_exit.h" | 5 #include "base/at_exit.h" |
6 #include "base/files/file_path.h" | 6 #include "base/files/file_path.h" |
7 #include "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/observer_list.h" | 9 #include "base/observer_list.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 1070 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1081 base::FilePath(FILE_PATH_LITERAL("foo.crx")))); | 1081 base::FilePath(FILE_PATH_LITERAL("foo.crx")))); |
1082 | 1082 |
1083 // First the history service must exist. | 1083 // First the history service must exist. |
1084 ASSERT_TRUE(profile()->CreateHistoryService(false, false)); | 1084 ASSERT_TRUE(profile()->CreateHistoryService(false, false)); |
1085 | 1085 |
1086 GURL url("http://visited.example.com/visited-link.html"); | 1086 GURL url("http://visited.example.com/visited-link.html"); |
1087 // The time of visit is picked to be several seconds prior to the most recent | 1087 // The time of visit is picked to be several seconds prior to the most recent |
1088 // midnight. | 1088 // midnight. |
1089 base::Time time_of_visit( | 1089 base::Time time_of_visit( |
1090 base::Time::Now().LocalMidnight() - base::TimeDelta::FromSeconds(10)); | 1090 base::Time::Now().LocalMidnight() - base::TimeDelta::FromSeconds(10)); |
1091 HistoryService* history_service = | 1091 HistoryService* history_service = HistoryServiceFactory::GetForProfile( |
1092 HistoryServiceFactory::GetForProfile(profile(), Profile::EXPLICIT_ACCESS); | 1092 profile(), ServiceAccessType::EXPLICIT_ACCESS); |
1093 ASSERT_TRUE(history_service); | 1093 ASSERT_TRUE(history_service); |
1094 history_service->AddPage(url, time_of_visit, history::SOURCE_BROWSED); | 1094 history_service->AddPage(url, time_of_visit, history::SOURCE_BROWSED); |
1095 | 1095 |
1096 RunTestCasesWithActiveItem(kVisitedReferrerCases, | 1096 RunTestCasesWithActiveItem(kVisitedReferrerCases, |
1097 arraysize(kVisitedReferrerCases)); | 1097 arraysize(kVisitedReferrerCases)); |
1098 } | 1098 } |
1099 | 1099 |
1100 // These test cases are run with "Prompt for download" user preference set to | 1100 // These test cases are run with "Prompt for download" user preference set to |
1101 // true. | 1101 // true. |
1102 TEST_F(DownloadTargetDeterminerTest, TargetDeterminer_PromptAlways) { | 1102 TEST_F(DownloadTargetDeterminerTest, TargetDeterminer_PromptAlways) { |
(...skipping 1079 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2182 EXPECT_CALL(mock_plugin_filter_, MockPluginAvailable(npapi_plugin.path())) | 2182 EXPECT_CALL(mock_plugin_filter_, MockPluginAvailable(npapi_plugin.path())) |
2183 .WillRepeatedly(Return(true)); | 2183 .WillRepeatedly(Return(true)); |
2184 | 2184 |
2185 target_info = RunDownloadTargetDeterminer( | 2185 target_info = RunDownloadTargetDeterminer( |
2186 GetPathInDownloadDir(kInitialPath), item.get()); | 2186 GetPathInDownloadDir(kInitialPath), item.get()); |
2187 EXPECT_FALSE(target_info->is_filetype_handled_safely); | 2187 EXPECT_FALSE(target_info->is_filetype_handled_safely); |
2188 } | 2188 } |
2189 #endif // defined(ENABLE_PLUGINS) | 2189 #endif // defined(ENABLE_PLUGINS) |
2190 | 2190 |
2191 } // namespace | 2191 } // namespace |
OLD | NEW |