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

Side by Side Diff: chrome/browser/download/download_commands_unittest.cc

Issue 1084123004: [Downloads] Add context parameter to help center article URL. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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/download/download_commands.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/download/download_commands.h" 5 #include "chrome/browser/download/download_commands.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/strings/stringprintf.h"
9 #include "content/public/test/mock_download_item.h" 10 #include "content/public/test/mock_download_item.h"
10 #include "testing/gmock/include/gmock/gmock.h" 11 #include "testing/gmock/include/gmock/gmock.h"
11 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
12 13
13 using content::DownloadItem; 14 using content::DownloadItem;
14 using ::testing::Mock; 15 using ::testing::Mock;
15 using ::testing::NiceMock; 16 using ::testing::NiceMock;
16 using ::testing::Return; 17 using ::testing::Return;
17 using ::testing::ReturnRefOfCopy; 18 using ::testing::ReturnRefOfCopy;
18 using ::testing::_; 19 using ::testing::_;
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 // Pause. 148 // Pause.
148 EXPECT_CALL(item(), Pause()).Times(1); 149 EXPECT_CALL(item(), Pause()).Times(1);
149 commands().ExecuteCommand(DownloadCommands::PAUSE); 150 commands().ExecuteCommand(DownloadCommands::PAUSE);
150 } 151 }
151 152
152 TEST_F(DownloadCommandsTest, DoResume) { 153 TEST_F(DownloadCommandsTest, DoResume) {
153 // Resume. 154 // Resume.
154 EXPECT_CALL(item(), Resume()).Times(1); 155 EXPECT_CALL(item(), Resume()).Times(1);
155 commands().ExecuteCommand(DownloadCommands::RESUME); 156 commands().ExecuteCommand(DownloadCommands::RESUME);
156 } 157 }
158
159 TEST_F(DownloadCommandsTest,
160 GetLearnMoreURLForInterruptedDownload_ContainsContext) {
161 EXPECT_CALL(item(), GetLastReason())
162 .WillOnce(
163 Return(content::DOWNLOAD_INTERRUPT_REASON_NETWORK_DISCONNECTED));
164 GURL learn_more_url = commands().GetLearnMoreURLForInterruptedDownload();
165 std::string name_value_pair = base::StringPrintf(
166 "ctx=%d", content::DOWNLOAD_INTERRUPT_REASON_NETWORK_DISCONNECTED);
167 EXPECT_LT(0u, learn_more_url.query().find(name_value_pair))
168 << learn_more_url.spec();
169 }
OLDNEW
« no previous file with comments | « chrome/browser/download/download_commands.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698