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 731075d6e9f9cea2116d7c2bea9fb89881e05bf7..2b2b57c5d86630bdec48cb5f60e2e97b3847d515 100644 |
--- a/chrome/browser/download/download_danger_prompt_browsertest.cc |
+++ b/chrome/browser/download/download_danger_prompt_browsertest.cc |
@@ -5,6 +5,7 @@ |
#include "base/bind.h" |
#include "base/files/file_path.h" |
#include "chrome/browser/download/download_danger_prompt.h" |
+#include "chrome/browser/profiles/profile.h" |
#include "chrome/browser/ui/browser.h" |
#include "chrome/browser/ui/browser_commands.h" |
#include "chrome/browser/ui/browser_tabstrip.h" |
@@ -14,11 +15,13 @@ |
#include "content/public/test/mock_download_item.h" |
#include "testing/gmock/include/gmock/gmock.h" |
#include "testing/gtest/include/gtest/gtest.h" |
+#include "url/gurl.h" |
using ::testing::_; |
using ::testing::ByRef; |
using ::testing::Eq; |
using ::testing::Return; |
+using ::testing::ReturnRef; |
using ::testing::SaveArg; |
class DownloadDangerPromptTest : public InProcessBrowserTest { |
@@ -100,6 +103,13 @@ class DownloadDangerPromptTest : public InProcessBrowserTest { |
}; |
IN_PROC_BROWSER_TEST_F(DownloadDangerPromptTest, TestAll) { |
+ // ExperienceSampling: Set default actions for DownloadItem methods we need. |
+ ON_CALL(download(), GetURL()).WillByDefault(ReturnRef(GURL::EmptyGURL())); |
+ ON_CALL(download(), GetReferrerUrl()) |
+ .WillByDefault(ReturnRef(GURL::EmptyGURL())); |
+ ON_CALL(download(), GetBrowserContext()) |
+ .WillByDefault(Return(browser()->profile())); |
+ |
OpenNewTab(); |
// Clicking the Accept button should invoke the ACCEPT action. |