OLD | NEW |
---|---|
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/test/component_updater_service_unitte st.h" | 5 #include "chrome/browser/component_updater/test/component_updater_service_unitte st.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
11 #include "base/run_loop.h" | 11 #include "base/run_loop.h" |
12 #include "base/strings/string_number_conversions.h" | 12 #include "base/strings/string_number_conversions.h" |
13 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
14 #include "base/strings/stringprintf.h" | 14 #include "base/strings/stringprintf.h" |
15 #include "base/values.h" | 15 #include "base/values.h" |
16 #include "chrome/browser/component_updater/component_updater_resource_throttle.h " | 16 #include "chrome/browser/component_updater/component_updater_resource_throttle.h " |
17 #include "chrome/browser/component_updater/test/test_configurator.h" | 17 #include "chrome/browser/component_updater/test/test_configurator.h" |
18 #include "chrome/browser/component_updater/test/test_installer.h" | 18 #include "chrome/browser/component_updater/test/test_installer.h" |
19 #include "chrome/common/chrome_paths.h" | 19 #include "chrome/common/chrome_paths.h" |
20 #include "components/component_updater/component_updater_utils.h" | 20 #include "components/component_updater/component_updater_utils.h" |
21 #include "content/public/browser/browser_thread.h" | 21 #include "content/public/browser/browser_thread.h" |
Sorin Jianu
2014/08/26 20:32:51
Are we doing something about the browser thread?
tommycli
2014/08/26 21:06:58
Hi. The CUS unit-test is going to stay put for now
| |
22 #include "content/public/browser/resource_controller.h" | 22 #include "content/public/browser/resource_controller.h" |
Sorin Jianu
2014/08/26 20:32:51
Tommy, what have we decided to do about the resour
tommycli
2014/08/26 21:06:58
We decided that the ResourceThrottle is going to s
| |
23 #include "content/public/browser/resource_request_info.h" | 23 #include "content/public/browser/resource_request_info.h" |
24 #include "content/public/browser/resource_throttle.h" | 24 #include "content/public/browser/resource_throttle.h" |
25 #include "libxml/globals.h" | 25 #include "libxml/globals.h" |
26 #include "net/base/upload_bytes_element_reader.h" | 26 #include "net/base/upload_bytes_element_reader.h" |
27 #include "net/url_request/url_fetcher.h" | 27 #include "net/url_request/url_fetcher.h" |
28 #include "net/url_request/url_request_test_util.h" | 28 #include "net/url_request/url_request_test_util.h" |
29 #include "url/gurl.h" | 29 #include "url/gurl.h" |
30 | 30 |
31 using content::BrowserThread; | 31 using content::BrowserThread; |
32 | 32 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
72 test_data_dir_ = test_data_dir_.AppendASCII("components"); | 72 test_data_dir_ = test_data_dir_.AppendASCII("components"); |
73 | 73 |
74 net::URLFetcher::SetEnableInterceptionForTests(true); | 74 net::URLFetcher::SetEnableInterceptionForTests(true); |
75 } | 75 } |
76 | 76 |
77 ComponentUpdaterTest::~ComponentUpdaterTest() { | 77 ComponentUpdaterTest::~ComponentUpdaterTest() { |
78 net::URLFetcher::SetEnableInterceptionForTests(false); | 78 net::URLFetcher::SetEnableInterceptionForTests(false); |
79 } | 79 } |
80 | 80 |
81 void ComponentUpdaterTest::SetUp() { | 81 void ComponentUpdaterTest::SetUp() { |
82 get_interceptor_.reset(new GetInterceptor); | 82 get_interceptor_.reset(new GetInterceptor( |
83 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), | |
84 BrowserThread::GetBlockingPool()->GetTaskRunnerWithShutdownBehavior( | |
85 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN))); | |
83 interceptor_factory_.reset(new InterceptorFactory); | 86 interceptor_factory_.reset(new InterceptorFactory); |
84 post_interceptor_ = interceptor_factory_->CreateInterceptor(); | 87 post_interceptor_ = interceptor_factory_->CreateInterceptor(); |
85 EXPECT_TRUE(post_interceptor_); | 88 EXPECT_TRUE(post_interceptor_); |
86 } | 89 } |
87 | 90 |
88 void ComponentUpdaterTest::TearDown() { | 91 void ComponentUpdaterTest::TearDown() { |
89 interceptor_factory_.reset(); | 92 interceptor_factory_.reset(); |
90 get_interceptor_.reset(); | 93 get_interceptor_.reset(); |
91 xmlCleanupGlobals(); | 94 xmlCleanupGlobals(); |
92 } | 95 } |
(...skipping 1403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1496 component_updater()->RemoveObserver(&observer2); | 1499 component_updater()->RemoveObserver(&observer2); |
1497 | 1500 |
1498 test_configurator()->SetLoopCount(1); | 1501 test_configurator()->SetLoopCount(1); |
1499 component_updater()->Start(); | 1502 component_updater()->Start(); |
1500 RunThreads(); | 1503 RunThreads(); |
1501 | 1504 |
1502 component_updater()->Stop(); | 1505 component_updater()->Stop(); |
1503 } | 1506 } |
1504 | 1507 |
1505 } // namespace component_updater | 1508 } // namespace component_updater |
OLD | NEW |