OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/autoupdate_interceptor.h" | 5 #include "chrome/browser/extensions/autoupdate_interceptor.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/thread_restrictions.h" | 8 #include "base/threading/thread_restrictions.h" |
9 #include "chrome/browser/browser_thread.h" | 9 #include "chrome/browser/browser_thread.h" |
10 #include "net/url_request/url_request_test_job.h" | 10 #include "net/url_request/url_request_test_job.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
12 | 12 |
13 // This is a specialized version of URLRequestTestJob that lets us specify | 13 // This is a specialized version of URLRequestTestJob that lets us specify |
14 // response data and make sure the response code is 200, which the autoupdate | 14 // response data and make sure the response code is 200, which the autoupdate |
15 // code relies on. | 15 // code relies on. |
16 class AutoUpdateTestRequestJob : public URLRequestTestJob { | 16 class AutoUpdateTestRequestJob : public URLRequestTestJob { |
17 public: | 17 public: |
18 AutoUpdateTestRequestJob(net::URLRequest* request, | 18 AutoUpdateTestRequestJob(net::URLRequest* request, |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 responses_[gurl] = path; | 76 responses_[gurl] = path; |
77 } | 77 } |
78 | 78 |
79 | 79 |
80 void AutoUpdateInterceptor::SetResponseOnIOThread(const std::string url, | 80 void AutoUpdateInterceptor::SetResponseOnIOThread(const std::string url, |
81 const FilePath& path) { | 81 const FilePath& path) { |
82 BrowserThread::PostTask( | 82 BrowserThread::PostTask( |
83 BrowserThread::IO, FROM_HERE, | 83 BrowserThread::IO, FROM_HERE, |
84 NewRunnableMethod(this, &AutoUpdateInterceptor::SetResponse, url, path)); | 84 NewRunnableMethod(this, &AutoUpdateInterceptor::SetResponse, url, path)); |
85 } | 85 } |
OLD | NEW |