Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(585)

Side by Side Diff: chrome/browser/plugins/plugin_installer_unittest.cc

Issue 1579863003: Convert Pass()→std::move() for Mac build. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/plugins/plugin_installer.cc ('k') | chrome/browser/plugins/plugin_observer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "chrome/browser/plugins/plugin_installer.h" 5 #include "chrome/browser/plugins/plugin_installer.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "chrome/browser/plugins/plugin_installer_observer.h" 9 #include "chrome/browser/plugins/plugin_installer_observer.h"
10 #include "chrome/test/base/chrome_render_view_host_test_harness.h" 10 #include "chrome/test/base/chrome_render_view_host_test_harness.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 installer_.reset(); 44 installer_.reset();
45 content::RenderViewHostTestHarness::TearDown(); 45 content::RenderViewHostTestHarness::TearDown();
46 } 46 }
47 47
48 scoped_ptr<content::MockDownloadItem> 48 scoped_ptr<content::MockDownloadItem>
49 PluginInstallerTest::CreateMockDownloadItem() { 49 PluginInstallerTest::CreateMockDownloadItem() {
50 scoped_ptr<content::MockDownloadItem> mock_download_item( 50 scoped_ptr<content::MockDownloadItem> mock_download_item(
51 new testing::StrictMock<content::MockDownloadItem>()); 51 new testing::StrictMock<content::MockDownloadItem>());
52 ON_CALL(*mock_download_item, GetState()) 52 ON_CALL(*mock_download_item, GetState())
53 .WillByDefault(testing::Return(content::DownloadItem::IN_PROGRESS)); 53 .WillByDefault(testing::Return(content::DownloadItem::IN_PROGRESS));
54 return mock_download_item.Pass(); 54 return mock_download_item;
55 } 55 }
56 56
57 class TestPluginInstallerObserver : public PluginInstallerObserver { 57 class TestPluginInstallerObserver : public PluginInstallerObserver {
58 public: 58 public:
59 explicit TestPluginInstallerObserver(PluginInstaller* installer) 59 explicit TestPluginInstallerObserver(PluginInstaller* installer)
60 : PluginInstallerObserver(installer), 60 : PluginInstallerObserver(installer),
61 download_started_(false), 61 download_started_(false),
62 download_finished_(false), 62 download_finished_(false),
63 download_cancelled_(false) {} 63 download_cancelled_(false) {}
64 64
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 EXPECT_CALL(*download_item, GetState()) 180 EXPECT_CALL(*download_item, GetState())
181 .WillOnce(testing::Return(content::DownloadItem::INTERRUPTED)); 181 .WillOnce(testing::Return(content::DownloadItem::INTERRUPTED));
182 EXPECT_CALL(*download_item, GetLastReason()).WillOnce( 182 EXPECT_CALL(*download_item, GetLastReason()).WillOnce(
183 testing::Return(content::DOWNLOAD_INTERRUPT_REASON_NETWORK_FAILED)); 183 testing::Return(content::DOWNLOAD_INTERRUPT_REASON_NETWORK_FAILED));
184 download_item->NotifyObserversDownloadUpdated(); 184 download_item->NotifyObserversDownloadUpdated();
185 185
186 EXPECT_TRUE(installer_observer.download_started()); 186 EXPECT_TRUE(installer_observer.download_started());
187 EXPECT_FALSE(installer_observer.download_finished()); 187 EXPECT_FALSE(installer_observer.download_finished());
188 EXPECT_EQ("NETWORK_FAILED", installer_observer.download_error()); 188 EXPECT_EQ("NETWORK_FAILED", installer_observer.download_error());
189 } 189 }
OLDNEW
« no previous file with comments | « chrome/browser/plugins/plugin_installer.cc ('k') | chrome/browser/plugins/plugin_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698