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/compiler_specific.h" | 5 #include "base/compiler_specific.h" |
6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
10 #include "chrome/browser/download/download_item_model.h" | 10 #include "chrome/browser/download/download_item_model.h" |
11 #include "chrome/browser/download/download_service.h" | 11 #include "chrome/browser/download/download_service.h" |
12 #include "chrome/browser/download/download_service_factory.h" | 12 #include "chrome/browser/download/download_service_factory.h" |
13 #include "chrome/browser/download/test_download_shelf.h" | 13 #include "chrome/browser/download/test_download_shelf.h" |
14 #include "chrome/common/extensions/extension.h" | |
15 #include "chrome/test/base/testing_profile.h" | 14 #include "chrome/test/base/testing_profile.h" |
16 #include "content/public/browser/notification_service.h" | 15 #include "content/public/browser/notification_service.h" |
17 #include "content/public/test/mock_download_item.h" | 16 #include "content/public/test/mock_download_item.h" |
18 #include "content/public/test/mock_download_manager.h" | 17 #include "content/public/test/mock_download_manager.h" |
19 #include "content/public/test/test_browser_thread.h" | 18 #include "content/public/test/test_browser_thread.h" |
| 19 #include "extensions/common/extension.h" |
20 #include "testing/gmock/include/gmock/gmock.h" | 20 #include "testing/gmock/include/gmock/gmock.h" |
21 #include "testing/gtest/include/gtest/gtest.h" | 21 #include "testing/gtest/include/gtest/gtest.h" |
22 | 22 |
23 using ::testing::Return; | 23 using ::testing::Return; |
24 using ::testing::ReturnRefOfCopy; | 24 using ::testing::ReturnRefOfCopy; |
25 using ::testing::SaveArg; | 25 using ::testing::SaveArg; |
26 using ::testing::_; | 26 using ::testing::_; |
27 using content::DownloadItem; | 27 using content::DownloadItem; |
28 | 28 |
29 namespace { | 29 namespace { |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 .WillRepeatedly(Return(false)); | 207 .WillRepeatedly(Return(false)); |
208 ASSERT_FALSE(DownloadItemModel(download_item()) | 208 ASSERT_FALSE(DownloadItemModel(download_item()) |
209 .ShouldRemoveFromShelfWhenComplete()); | 209 .ShouldRemoveFromShelfWhenComplete()); |
210 | 210 |
211 base::RunLoop run_loop; | 211 base::RunLoop run_loop; |
212 run_loop.RunUntilIdle(); | 212 run_loop.RunUntilIdle(); |
213 | 213 |
214 EXPECT_TRUE(shelf()->did_add_download()); | 214 EXPECT_TRUE(shelf()->did_add_download()); |
215 EXPECT_TRUE(shelf()->IsShowing()); | 215 EXPECT_TRUE(shelf()->IsShowing()); |
216 } | 216 } |
OLD | NEW |