| 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 // Disable everything on windows only. http://crbug.com/306144 | 5 // Disable everything on windows only. http://crbug.com/306144 |
| 6 #ifndef OS_WIN | 6 #ifndef OS_WIN |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 | 309 |
| 310 void RemoveFilenameDeterminer(content::RenderProcessHost* host) { | 310 void RemoveFilenameDeterminer(content::RenderProcessHost* host) { |
| 311 EventRouter::Get(current_browser()->profile())->RemoveEventListener( | 311 EventRouter::Get(current_browser()->profile())->RemoveEventListener( |
| 312 downloads::OnDeterminingFilename::kEventName, host, GetExtensionId()); | 312 downloads::OnDeterminingFilename::kEventName, host, GetExtensionId()); |
| 313 } | 313 } |
| 314 | 314 |
| 315 Browser* current_browser() { return current_browser_; } | 315 Browser* current_browser() { return current_browser_; } |
| 316 | 316 |
| 317 // InProcessBrowserTest | 317 // InProcessBrowserTest |
| 318 void SetUpOnMainThread() override { | 318 void SetUpOnMainThread() override { |
| 319 base::FeatureList::ClearInstanceForTesting(); | |
| 320 std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList); | |
| 321 feature_list->InitializeFromCommandLine( | |
| 322 features::kDownloadResumption.name, std::string()); | |
| 323 base::FeatureList::SetInstance(std::move(feature_list)); | |
| 324 | |
| 325 ExtensionApiTest::SetUpOnMainThread(); | 319 ExtensionApiTest::SetUpOnMainThread(); |
| 326 BrowserThread::PostTask( | 320 BrowserThread::PostTask( |
| 327 BrowserThread::IO, FROM_HERE, | 321 BrowserThread::IO, FROM_HERE, |
| 328 base::Bind(&chrome_browser_net::SetUrlRequestMocksEnabled, true)); | 322 base::Bind(&chrome_browser_net::SetUrlRequestMocksEnabled, true)); |
| 329 InProcessBrowserTest::SetUpOnMainThread(); | 323 InProcessBrowserTest::SetUpOnMainThread(); |
| 330 GoOnTheRecord(); | 324 GoOnTheRecord(); |
| 331 CreateAndSetDownloadsDirectory(); | 325 CreateAndSetDownloadsDirectory(); |
| 332 current_browser()->profile()->GetPrefs()->SetBoolean( | 326 current_browser()->profile()->GetPrefs()->SetBoolean( |
| 333 prefs::kPromptForDownload, false); | 327 prefs::kPromptForDownload, false); |
| 334 GetOnRecordManager()->RemoveAllDownloads(); | 328 GetOnRecordManager()->RemoveAllDownloads(); |
| (...skipping 3899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4234 EXPECT_EQ(downloads::FILENAME_CONFLICT_ACTION_PROMPT, conflict_action); | 4228 EXPECT_EQ(downloads::FILENAME_CONFLICT_ACTION_PROMPT, conflict_action); |
| 4235 EXPECT_FALSE(warnings.empty()); | 4229 EXPECT_FALSE(warnings.empty()); |
| 4236 EXPECT_EQ(Warning::kDownloadFilenameConflict, | 4230 EXPECT_EQ(Warning::kDownloadFilenameConflict, |
| 4237 warnings.begin()->warning_type()); | 4231 warnings.begin()->warning_type()); |
| 4238 EXPECT_EQ("incumbent", warnings.begin()->extension_id()); | 4232 EXPECT_EQ("incumbent", warnings.begin()->extension_id()); |
| 4239 } | 4233 } |
| 4240 | 4234 |
| 4241 } // namespace extensions | 4235 } // namespace extensions |
| 4242 | 4236 |
| 4243 #endif // http://crbug.com/306144 | 4237 #endif // http://crbug.com/306144 |
| OLD | NEW |