Chromium Code Reviews

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

Issue 1459793002: Android: Allow compiling browser without Java UI (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Index: chrome/browser/download/download_resource_throttle_unittest.cc
diff --git a/chrome/browser/download/download_resource_throttle_unittest.cc b/chrome/browser/download/download_resource_throttle_unittest.cc
index dd4365d49007853f263123ec16437691f687c813..8c320f768df0678e37385d3a47671cd008f54f77 100644
--- a/chrome/browser/download/download_resource_throttle_unittest.cc
+++ b/chrome/browser/download/download_resource_throttle_unittest.cc
@@ -7,6 +7,7 @@
#include "chrome/browser/download/download_request_limiter.h"
#include "chrome/browser/download/download_resource_throttle.h"
#include "chrome/browser/tab_contents/tab_util.h"
+#include "chrome/common/features.h"
#include "chrome/test/base/chrome_render_view_host_test_harness.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_process_host.h"
@@ -18,7 +19,7 @@
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
-#if defined(OS_ANDROID)
+#if BUILDFLAG(ANDROID_JAVA_UI)
#include "chrome/browser/android/download/mock_download_controller_android.h"
#endif
@@ -62,7 +63,7 @@ class DownloadResourceThrottleTest : public ChromeRenderViewHostTestHarness {
ChromeRenderViewHostTestHarness::SetUp();
web_contents()->SetDelegate(&delegate_);
run_loop_.reset(new base::RunLoop());
-#if defined(OS_ANDROID)
+#if BUILDFLAG(ANDROID_JAVA_UI)
content::DownloadControllerAndroid::SetDownloadControllerAndroid(
&download_controller_);
#endif
@@ -71,7 +72,7 @@ class DownloadResourceThrottleTest : public ChromeRenderViewHostTestHarness {
void TearDown() override {
content::BrowserThread::DeleteSoon(content::BrowserThread::IO, FROM_HERE,
throttle_);
-#if defined(OS_ANDROID)
+#if BUILDFLAG(ANDROID_JAVA_UI)
content::DownloadControllerAndroid::SetDownloadControllerAndroid(nullptr);
#endif
ChromeRenderViewHostTestHarness::TearDown();
@@ -104,7 +105,7 @@ class DownloadResourceThrottleTest : public ChromeRenderViewHostTestHarness {
scoped_refptr<DownloadRequestLimiter> limiter_;
::testing::NiceMock<MockResourceController> resource_controller_;
scoped_ptr<base::RunLoop> run_loop_;
-#if defined(OS_ANDROID)
+#if BUILDFLAG(ANDROID_JAVA_UI)
chrome::android::MockDownloadControllerAndroid download_controller_;
#endif
};
@@ -115,7 +116,7 @@ TEST_F(DownloadResourceThrottleTest, StartDownloadThrottle_Basic) {
StartThrottle();
}
-#if defined(OS_ANDROID)
+#if BUILDFLAG(ANDROID_JAVA_UI)
TEST_F(DownloadResourceThrottleTest, DownloadWithFailedFileAcecssRequest) {
content::DownloadControllerAndroid::Get()
->SetApproveFileAccessRequestForTesting(false);

Powered by Google App Engine