| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/extensions/api/image_writer_private/write_from_url_oper
ation.h" | 5 #include "chrome/browser/extensions/api/image_writer_private/write_from_url_oper
ation.h" |
| 6 | 6 |
| 7 #include "base/task_scheduler/post_task.h" | 7 #include "base/task_scheduler/post_task.h" |
| 8 #include "chrome/browser/extensions/api/image_writer_private/error_messages.h" | 8 #include "chrome/browser/extensions/api/image_writer_private/error_messages.h" |
| 9 #include "chrome/browser/extensions/api/image_writer_private/test_utils.h" | 9 #include "chrome/browser/extensions/api/image_writer_private/test_utils.h" |
| 10 #include "chrome/test/base/testing_profile.h" | 10 #include "chrome/test/base/testing_profile.h" |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 protected: | 75 protected: |
| 76 ImageWriterWriteFromUrlOperationTest() : manager_(&test_profile_) {} | 76 ImageWriterWriteFromUrlOperationTest() : manager_(&test_profile_) {} |
| 77 | 77 |
| 78 void SetUp() override { | 78 void SetUp() override { |
| 79 ImageWriterUnitTestBase::SetUp(); | 79 ImageWriterUnitTestBase::SetUp(); |
| 80 | 80 |
| 81 // Turn on interception and set up our dummy file. | 81 // Turn on interception and set up our dummy file. |
| 82 get_interceptor_.reset(new GetInterceptor( | 82 get_interceptor_.reset(new GetInterceptor( |
| 83 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO), | 83 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO), |
| 84 base::CreateTaskRunnerWithTraits( | 84 base::CreateTaskRunnerWithTraits( |
| 85 base::TaskTraits() | 85 {base::MayBlock(), base::TaskPriority::BACKGROUND, |
| 86 .MayBlock() | 86 base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN}))); |
| 87 .WithPriority(base::TaskPriority::BACKGROUND) | |
| 88 .WithShutdownBehavior( | |
| 89 base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN)))); | |
| 90 get_interceptor_->SetResponse(GURL(kTestImageUrl), | 87 get_interceptor_->SetResponse(GURL(kTestImageUrl), |
| 91 test_utils_.GetImagePath()); | 88 test_utils_.GetImagePath()); |
| 92 } | 89 } |
| 93 | 90 |
| 94 void TearDown() override { | 91 void TearDown() override { |
| 95 ImageWriterUnitTestBase::TearDown(); | 92 ImageWriterUnitTestBase::TearDown(); |
| 96 } | 93 } |
| 97 | 94 |
| 98 scoped_refptr<OperationForTest> CreateOperation(const GURL& url, | 95 scoped_refptr<OperationForTest> CreateOperation(const GURL& url, |
| 99 const std::string& hash) { | 96 const std::string& hash) { |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 | 207 |
| 211 base::RunLoop().RunUntilIdle(); | 208 base::RunLoop().RunUntilIdle(); |
| 212 | 209 |
| 213 operation->Cancel(); | 210 operation->Cancel(); |
| 214 } | 211 } |
| 215 | 212 |
| 216 } // namespace | 213 } // namespace |
| 217 | 214 |
| 218 } // namespace image_writer | 215 } // namespace image_writer |
| 219 } // namespace extensions | 216 } // namespace extensions |
| OLD | NEW |