| 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/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/file_path.h" | 6 #include "base/file_path.h" |
| 7 #include "chrome/browser/download/download_danger_prompt.h" | 7 #include "chrome/browser/download/download_danger_prompt.h" |
| 8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
| 9 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 9 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 10 #include "chrome/test/base/in_process_browser_test.h" | 10 #include "chrome/test/base/in_process_browser_test.h" |
| 11 #include "chrome/test/base/ui_test_utils.h" | 11 #include "chrome/test/base/ui_test_utils.h" |
| 12 #include "content/test/mock_download_item.h" | 12 #include "content/public/test/mock_download_item.h" |
| 13 #include "testing/gmock/include/gmock/gmock.h" | 13 #include "testing/gmock/include/gmock/gmock.h" |
| 14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
| 15 | 15 |
| 16 using ::testing::_; | 16 using ::testing::_; |
| 17 using ::testing::ByRef; | 17 using ::testing::ByRef; |
| 18 using ::testing::Eq; | 18 using ::testing::Eq; |
| 19 using ::testing::Return; | 19 using ::testing::Return; |
| 20 using ::testing::SaveArg; | 20 using ::testing::SaveArg; |
| 21 | 21 |
| 22 class DownloadDangerPromptTest : public InProcessBrowserTest { | 22 class DownloadDangerPromptTest : public InProcessBrowserTest { |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 EXPECT_CALL(download(), IsDangerous()).WillOnce(Return(false)); | 132 EXPECT_CALL(download(), IsDangerous()).WillOnce(Return(false)); |
| 133 download_observer()->OnDownloadUpdated(&download()); | 133 download_observer()->OnDownloadUpdated(&download()); |
| 134 VerifyExpectations(); | 134 VerifyExpectations(); |
| 135 | 135 |
| 136 // If the containing tab is closed, the dialog should be canceled. | 136 // If the containing tab is closed, the dialog should be canceled. |
| 137 OpenNewTab(); | 137 OpenNewTab(); |
| 138 SetUpExpectations(DownloadDangerPrompt::CANCEL); | 138 SetUpExpectations(DownloadDangerPrompt::CANCEL); |
| 139 browser()->CloseTab(); | 139 browser()->CloseTab(); |
| 140 VerifyExpectations(); | 140 VerifyExpectations(); |
| 141 } | 141 } |
| OLD | NEW |