OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/bind_helpers.h" | 6 #include "base/bind_helpers.h" |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 PathService::Get(base::DIR_SOURCE_ROOT, &path); | 33 PathService::Get(base::DIR_SOURCE_ROOT, &path); |
34 return path.AppendASCII("components").AppendASCII("test").AppendASCII("data") | 34 return path.AppendASCII("components").AppendASCII("test").AppendASCII("data") |
35 .AppendASCII("component_updater").AppendASCII(file); | 35 .AppendASCII("component_updater").AppendASCII(file); |
36 } | 36 } |
37 | 37 |
38 } // namespace | 38 } // namespace |
39 | 39 |
40 class CrxDownloaderTest : public testing::Test { | 40 class CrxDownloaderTest : public testing::Test { |
41 public: | 41 public: |
42 CrxDownloaderTest(); | 42 CrxDownloaderTest(); |
43 virtual ~CrxDownloaderTest(); | 43 ~CrxDownloaderTest() override; |
44 | 44 |
45 // Overrides from testing::Test. | 45 // Overrides from testing::Test. |
46 virtual void SetUp() override; | 46 void SetUp() override; |
47 virtual void TearDown() override; | 47 void TearDown() override; |
48 | 48 |
49 void Quit(); | 49 void Quit(); |
50 void RunThreads(); | 50 void RunThreads(); |
51 void RunThreadsUntilIdle(); | 51 void RunThreadsUntilIdle(); |
52 | 52 |
53 void DownloadComplete(int crx_context, const CrxDownloader::Result& result); | 53 void DownloadComplete(int crx_context, const CrxDownloader::Result& result); |
54 | 54 |
55 void DownloadProgress(int crx_context, const CrxDownloader::Result& result); | 55 void DownloadProgress(int crx_context, const CrxDownloader::Result& result); |
56 | 56 |
57 protected: | 57 protected: |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 | 369 |
370 EXPECT_EQ(0, get_interceptor_->GetHitCount()); | 370 EXPECT_EQ(0, get_interceptor_->GetHitCount()); |
371 | 371 |
372 EXPECT_EQ(1, num_download_complete_calls_); | 372 EXPECT_EQ(1, num_download_complete_calls_); |
373 EXPECT_EQ(kExpectedContext, crx_context_); | 373 EXPECT_EQ(kExpectedContext, crx_context_); |
374 EXPECT_NE(0, download_complete_result_.error); | 374 EXPECT_NE(0, download_complete_result_.error); |
375 EXPECT_TRUE(download_complete_result_.response.empty()); | 375 EXPECT_TRUE(download_complete_result_.response.empty()); |
376 } | 376 } |
377 | 377 |
378 } // namespace component_updater | 378 } // namespace component_updater |
OLD | NEW |