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 "chrome/browser/chrome_thread.h" | 8 #include "chrome/browser/chrome_thread.h" |
9 #include "net/url_request/url_request_test_job.h" | 9 #include "net/url_request/url_request_test_job.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 GURL gurl(url); | 61 GURL gurl(url); |
62 EXPECT_EQ("http", gurl.scheme()); | 62 EXPECT_EQ("http", gurl.scheme()); |
63 EXPECT_EQ("localhost", gurl.host()); | 63 EXPECT_EQ("localhost", gurl.host()); |
64 EXPECT_TRUE(file_util::PathExists(path)); | 64 EXPECT_TRUE(file_util::PathExists(path)); |
65 responses_[gurl] = path; | 65 responses_[gurl] = path; |
66 } | 66 } |
67 | 67 |
68 | 68 |
69 void AutoUpdateInterceptor::SetResponseOnIOThread(const std::string url, | 69 void AutoUpdateInterceptor::SetResponseOnIOThread(const std::string url, |
70 const FilePath& path) { | 70 const FilePath& path) { |
71 MessageLoop* io_loop = ChromeThread::GetMessageLoop(ChromeThread::IO); | 71 ChromeThread::PostTask( |
72 io_loop->PostTask(FROM_HERE, | 72 ChromeThread::IO, FROM_HERE, |
73 NewRunnableMethod(this, &AutoUpdateInterceptor::SetResponse, | 73 NewRunnableMethod(this, &AutoUpdateInterceptor::SetResponse, url, path)); |
74 url, path)); | |
75 } | 74 } |
OLD | NEW |