| 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 "chrome/browser/component_updater/component_updater_service.h" | 5 #include "chrome/browser/component_updater/component_updater_service.h" |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 return 0; | 57 return 0; |
| 58 } | 58 } |
| 59 | 59 |
| 60 virtual GURL UpdateUrl() OVERRIDE { return GURL("http://localhost/upd"); } | 60 virtual GURL UpdateUrl() OVERRIDE { return GURL("http://localhost/upd"); } |
| 61 | 61 |
| 62 virtual const char* ExtraRequestParams() OVERRIDE { return "extra=foo"; } | 62 virtual const char* ExtraRequestParams() OVERRIDE { return "extra=foo"; } |
| 63 | 63 |
| 64 virtual size_t UrlSizeLimit() OVERRIDE { return 256; } | 64 virtual size_t UrlSizeLimit() OVERRIDE { return 256; } |
| 65 | 65 |
| 66 virtual net::URLRequestContextGetter* RequestContext() OVERRIDE { | 66 virtual net::URLRequestContextGetter* RequestContext() OVERRIDE { |
| 67 return new net::TestURLRequestContextGetter( | 67 return new TestURLRequestContextGetter( |
| 68 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); | 68 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); |
| 69 } | 69 } |
| 70 | 70 |
| 71 // Don't use the utility process to decode files. | 71 // Don't use the utility process to decode files. |
| 72 virtual bool InProcess() OVERRIDE { return true; } | 72 virtual bool InProcess() OVERRIDE { return true; } |
| 73 | 73 |
| 74 virtual void OnEvent(Events event, int extra) OVERRIDE { } | 74 virtual void OnEvent(Events event, int extra) OVERRIDE { } |
| 75 | 75 |
| 76 // Set how many update checks are called, the default value is just once. | 76 // Set how many update checks are called, the default value is just once. |
| 77 void SetLoopCount(int times) { times_ = times; } | 77 void SetLoopCount(int times) { times_ = times; } |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 test_configurator()->SetLoopCount(1); | 408 test_configurator()->SetLoopCount(1); |
| 409 component_updater()->Start(); | 409 component_updater()->Start(); |
| 410 message_loop.Run(); | 410 message_loop.Run(); |
| 411 | 411 |
| 412 EXPECT_EQ(1, interceptor->hit_count()); | 412 EXPECT_EQ(1, interceptor->hit_count()); |
| 413 EXPECT_EQ(0, static_cast<TestInstaller*>(com.installer)->error()); | 413 EXPECT_EQ(0, static_cast<TestInstaller*>(com.installer)->error()); |
| 414 EXPECT_EQ(0, static_cast<TestInstaller*>(com.installer)->install_count()); | 414 EXPECT_EQ(0, static_cast<TestInstaller*>(com.installer)->install_count()); |
| 415 | 415 |
| 416 component_updater()->Stop(); | 416 component_updater()->Stop(); |
| 417 } | 417 } |
| OLD | NEW |