#include "content/public/test/mock_download_item.h"
#include "content/public/test/test_renderer_host.h"
#include "content/public/test/web_contents_tester.h"
-#include "extensions/common/extension.h"
#include "net/base/mime_util.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "content/public/common/webplugininfo.h"
#endif
+#if defined(ENABLE_EXTENSIONS)
+#include "extensions/common/extension.h"
+#endif
+
using ::testing::AnyNumber;
using ::testing::Invoke;
using ::testing::Ref;
class NullWebContentsDelegate : public content::WebContentsDelegate {
public:
NullWebContentsDelegate() {}
- virtual ~NullWebContentsDelegate() {}
+ ~NullWebContentsDelegate() override {}
};
// Google Mock action that posts a task to the current message loop that invokes
class DownloadTargetDeterminerTest : public ChromeRenderViewHostTestHarness {
public:
// ::testing::Test
- virtual void SetUp() OVERRIDE;
- virtual void TearDown() OVERRIDE;
+ virtual void SetUp() override;
+ virtual void TearDown() override;
// Creates MockDownloadItem and sets up default expectations.
content::MockDownloadItem* CreateActiveDownloadItem(
arraysize(kPromptingTestCases));
}
-#if !defined(OS_ANDROID)
+#if defined(ENABLE_EXTENSIONS)
// These test cases are run with "Prompt for download" user preference set to
// true. Automatic extension downloads shouldn't cause prompting.
// Android doesn't support extensions.
RunTestCasesWithActiveItem(kPromptingTestCases,
arraysize(kPromptingTestCases));
}
-#endif
+#endif // defined(ENABLE_EXTENSIONS)
// If the download path is managed, then we don't show any prompts.
// Note that if the download path is managed, then PromptForDownload() is false.
download_util::GetFileDangerLevel(
base::FilePath(FILE_PATH_LITERAL("foo.crx"))));
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kIntermediateNameTestCases); ++i) {
+ for (size_t i = 0; i < arraysize(kIntermediateNameTestCases); ++i) {
SCOPED_TRACE(testing::Message() << "Running test case " << i);
const IntermediateNameTestCase& test_case = kIntermediateNameTestCases[i];
scoped_ptr<content::MockDownloadItem> item(
.WillByDefault(WithArg<1>(
ScheduleCallback("image/png")));
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kMIMETypeTestCases); ++i) {
+ for (size_t i = 0; i < arraysize(kMIMETypeTestCases); ++i) {
SCOPED_TRACE(testing::Message() << "Running test case " << i);
const MIMETypeTestCase& test_case = kMIMETypeTestCases[i];
scoped_ptr<content::MockDownloadItem> item(
const void* context,
const GURL& url,
const GURL& policy_url,
- content::WebPluginInfo* plugin) OVERRIDE {
+ content::WebPluginInfo* plugin) override {
return MockPluginAvailable(plugin->path);
}
virtual bool CanLoadPlugin(int render_process_id,
- const base::FilePath& path) OVERRIDE {
+ const base::FilePath& path) override {
return true;
}
};
DownloadTargetDeterminerTestWithPlugin()
: old_plugin_service_filter_(NULL) {}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
content::PluginService* plugin_service =
content::PluginService::GetInstance();
plugin_service->Init();
DownloadTargetDeterminerTest::SetUp();
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
content::PluginService::GetInstance()->SetFilter(
old_plugin_service_filter_);
DownloadTargetDeterminerTest::TearDown();