| 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 <stddef.h> |
| 6 |
| 5 #include "base/memory/scoped_vector.h" | 7 #include "base/memory/scoped_vector.h" |
| 6 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
| 7 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 8 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| 9 #include "chrome/browser/download/download_status_updater.h" | 11 #include "chrome/browser/download/download_status_updater.h" |
| 10 #include "content/public/test/mock_download_item.h" | 12 #include "content/public/test/mock_download_item.h" |
| 11 #include "content/public/test/mock_download_manager.h" | 13 #include "content/public/test/mock_download_manager.h" |
| 12 #include "content/public/test/test_browser_thread.h" | 14 #include "content/public/test/test_browser_thread.h" |
| 13 #include "testing/gmock/include/gmock/gmock.h" | 15 #include "testing/gmock/include/gmock/gmock.h" |
| 14 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 SetItemValues(0, 0, 10, 20, false); | 335 SetItemValues(0, 0, 10, 20, false); |
| 334 SetItemValues(0, 1, 50, 60, false); | 336 SetItemValues(0, 1, 50, 60, false); |
| 335 SetItemValues(1, 0, 80, 90, false); | 337 SetItemValues(1, 0, 80, 90, false); |
| 336 | 338 |
| 337 float progress = -1; | 339 float progress = -1; |
| 338 int download_count = -1; | 340 int download_count = -1; |
| 339 EXPECT_TRUE(updater_->GetProgress(&progress, &download_count)); | 341 EXPECT_TRUE(updater_->GetProgress(&progress, &download_count)); |
| 340 EXPECT_FLOAT_EQ((10+50+80)/(20.0f+60+90), progress); | 342 EXPECT_FLOAT_EQ((10+50+80)/(20.0f+60+90), progress); |
| 341 EXPECT_EQ(3, download_count); | 343 EXPECT_EQ(3, download_count); |
| 342 } | 344 } |
| OLD | NEW |