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 "base/memory/scoped_ptr.h" | 5 #include "base/memory/scoped_ptr.h" |
6 #include "base/memory/weak_ptr.h" | 6 #include "base/memory/weak_ptr.h" |
7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
9 #include "chrome/browser/download/download_status_updater.h" | 9 #include "chrome/browser/download/download_status_updater.h" |
10 #include "content/browser/download/download_request_handle.h" | |
11 #include "content/browser/download/download_types.h" | 10 #include "content/browser/download/download_types.h" |
12 #include "content/test/mock_download_item.h" | 11 #include "content/test/mock_download_item.h" |
13 #include "content/test/mock_download_manager.h" | 12 #include "content/test/mock_download_manager.h" |
14 #include "content/test/test_browser_thread.h" | 13 #include "content/test/test_browser_thread.h" |
15 #include "testing/gmock/include/gmock/gmock.h" | 14 #include "testing/gmock/include/gmock/gmock.h" |
16 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
17 | 16 |
18 | 17 |
19 using ::testing::AtLeast; | 18 using ::testing::AtLeast; |
20 using ::testing::Mock; | 19 using ::testing::Mock; |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 SetItemValues(0, 0, 10, 20); | 280 SetItemValues(0, 0, 10, 20); |
282 SetItemValues(0, 1, 50, 60); | 281 SetItemValues(0, 1, 50, 60); |
283 SetItemValues(1, 0, 80, 90); | 282 SetItemValues(1, 0, 80, 90); |
284 | 283 |
285 float progress = -1; | 284 float progress = -1; |
286 int download_count = -1; | 285 int download_count = -1; |
287 EXPECT_TRUE(updater_->GetProgress(&progress, &download_count)); | 286 EXPECT_TRUE(updater_->GetProgress(&progress, &download_count)); |
288 EXPECT_FLOAT_EQ((10+50+80)/(20.0f+60+90), progress); | 287 EXPECT_FLOAT_EQ((10+50+80)/(20.0f+60+90), progress); |
289 EXPECT_EQ(3, download_count); | 288 EXPECT_EQ(3, download_count); |
290 } | 289 } |
OLD | NEW |