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

Unified Diff: chrome/browser/download/download_danger_prompt_browsertest.cc

Issue 16924017: A few minor changes to the chrome.downloads extension API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: @r214130 Created 7 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/download/download_danger_prompt.cc ('k') | chrome/browser/download/download_query.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_danger_prompt_browsertest.cc
diff --git a/chrome/browser/download/download_danger_prompt_browsertest.cc b/chrome/browser/download/download_danger_prompt_browsertest.cc
index 5a7c9e8b9b5e45a5c4903c5b262421d062f3b71f..f203b71ff0126a9e1e5385955c0e5cf2cf72e0c9 100644
--- a/chrome/browser/download/download_danger_prompt_browsertest.cc
+++ b/chrome/browser/download/download_danger_prompt_browsertest.cc
@@ -86,10 +86,7 @@ class DownloadDangerPromptTest : public InProcessBrowserTest {
&download_,
browser()->tab_strip_model()->GetActiveWebContents(),
false,
- base::Bind(&DownloadDangerPromptTest::PromptCallback, this,
- DownloadDangerPrompt::ACCEPT),
- base::Bind(&DownloadDangerPromptTest::PromptCallback, this,
- DownloadDangerPrompt::CANCEL));
+ base::Bind(&DownloadDangerPromptTest::PromptCallback, this));
content::RunAllPendingInMessageLoop();
}
@@ -112,26 +109,26 @@ class DownloadDangerPromptTest : public InProcessBrowserTest {
IN_PROC_BROWSER_TEST_F(DownloadDangerPromptTest, TestAll) {
OpenNewTab();
- // The Accept action should cause the accept callback to be invoked.
+ // Clicking the Accept button should invoke the ACCEPT action.
SetUpExpectations(DownloadDangerPrompt::ACCEPT);
SimulatePromptAction(DownloadDangerPrompt::ACCEPT);
VerifyExpectations();
- // The Discard action should cause the discard callback to be invoked.
+ // Clicking the Cancel button should invoke the CANCEL action.
SetUpExpectations(DownloadDangerPrompt::CANCEL);
SimulatePromptAction(DownloadDangerPrompt::CANCEL);
VerifyExpectations();
// If the download is no longer dangerous (because it was accepted), the
- // dialog should dismiss itself.
- SetUpExpectations(DownloadDangerPrompt::CANCEL);
+ // dialog should DISMISS itself.
+ SetUpExpectations(DownloadDangerPrompt::DISMISS);
EXPECT_CALL(download(), IsDangerous()).WillOnce(Return(false));
download_observer()->OnDownloadUpdated(&download());
VerifyExpectations();
- // If the download is in a terminal state then the dialog should dismiss
+ // If the download is in a terminal state then the dialog should DISMISS
// itself.
- SetUpExpectations(DownloadDangerPrompt::CANCEL);
+ SetUpExpectations(DownloadDangerPrompt::DISMISS);
EXPECT_CALL(download(), IsDangerous()).WillOnce(Return(true));
EXPECT_CALL(download(), IsDone()).WillOnce(Return(true));
download_observer()->OnDownloadUpdated(&download());
@@ -146,8 +143,10 @@ IN_PROC_BROWSER_TEST_F(DownloadDangerPromptTest, TestAll) {
SimulatePromptAction(DownloadDangerPrompt::ACCEPT);
VerifyExpectations();
- // If the containing tab is closed, the dialog should be canceled.
+ // If the containing tab is closed, the dialog should DISMISS itself.
OpenNewTab();
+ // TODO(benjhayden):
+ // SetUpExpectations(DownloadDangerPrompt::DISMISS);
SetUpExpectations(DownloadDangerPrompt::CANCEL);
chrome::CloseTab(browser());
VerifyExpectations();
« no previous file with comments | « chrome/browser/download/download_danger_prompt.cc ('k') | chrome/browser/download/download_query.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698