Commit f9afb370 authored by dcheng's avatar dcheng Committed by Commit bot

Standardize usage of virtual/override/final specifiers.

The Google C++ style guide states:

  Explicitly annotate overrides of virtual functions or virtual
  destructors with an override or (less frequently) final specifier.
  Older (pre-C++11) code will use the virtual keyword as an inferior
  alternative annotation. For clarity, use exactly one of override,
  final, or virtual when declaring an override.

To better conform to these guidelines, the following constructs have
been rewritten:

- if a base class has a virtual destructor, then:
    virtual ~Foo();                   ->  ~Foo() override;
- virtual void Foo() override;        ->  void Foo() override;
- virtual void Foo() override final;  ->  void Foo() final;

This patch was automatically generated. The clang plugin can generate
fixit hints, which are suggested edits when it is 100% sure it knows how
to fix a problem. The hints from the clang plugin were applied to the
source tree using the tool in https://codereview.chromium.org/598073004.

BUG=417463
R=jyasskin@chromium.org

Review URL: https://codereview.chromium.org/685503002

Cr-Commit-Position: refs/heads/master@{#301450}
parent 1d5884e1
...@@ -43,7 +43,7 @@ class BluetoothEventRouterTest : public ExtensionsTest { ...@@ -43,7 +43,7 @@ class BluetoothEventRouterTest : public ExtensionsTest {
router_->SetAdapterForTest(mock_adapter_); router_->SetAdapterForTest(mock_adapter_);
} }
virtual void TearDown() override { void TearDown() override {
// It's important to destroy the router before the browser context keyed // It's important to destroy the router before the browser context keyed
// services so it removes itself as an ExtensionRegistry observer. // services so it removes itself as an ExtensionRegistry observer.
router_.reset(NULL); router_.reset(NULL);
......
...@@ -44,7 +44,7 @@ class BluetoothPrivateApiTest : public ExtensionApiTest { ...@@ -44,7 +44,7 @@ class BluetoothPrivateApiTest : public ExtensionApiTest {
adapter_powered_(false), adapter_powered_(false),
adapter_discoverable_(false) {} adapter_discoverable_(false) {}
virtual ~BluetoothPrivateApiTest() {} ~BluetoothPrivateApiTest() override {}
void SetUpOnMainThread() override { void SetUpOnMainThread() override {
CommandLine::ForCurrentProcess()->AppendSwitchASCII( CommandLine::ForCurrentProcess()->AppendSwitchASCII(
......
...@@ -93,7 +93,7 @@ class BluetoothLowEnergyApiTest : public ExtensionApiTest { ...@@ -93,7 +93,7 @@ class BluetoothLowEnergyApiTest : public ExtensionApiTest {
public: public:
BluetoothLowEnergyApiTest() {} BluetoothLowEnergyApiTest() {}
virtual ~BluetoothLowEnergyApiTest() {} ~BluetoothLowEnergyApiTest() override {}
void SetUpOnMainThread() override { void SetUpOnMainThread() override {
ExtensionApiTest::SetUpOnMainThread(); ExtensionApiTest::SetUpOnMainThread();
......
...@@ -15,9 +15,9 @@ namespace cast_channel { ...@@ -15,9 +15,9 @@ namespace cast_channel {
class CastFramerTest : public testing::Test { class CastFramerTest : public testing::Test {
public: public:
CastFramerTest() {} CastFramerTest() {}
virtual ~CastFramerTest() {} ~CastFramerTest() override {}
virtual void SetUp() override { void SetUp() override {
cast_message_.set_protocol_version(CastMessage::CASTV2_1_0); cast_message_.set_protocol_version(CastMessage::CASTV2_1_0);
cast_message_.set_source_id("source"); cast_message_.set_source_id("source");
cast_message_.set_destination_id("destination"); cast_message_.set_destination_id("destination");
......
...@@ -349,9 +349,9 @@ class CastSocketTest : public testing::Test { ...@@ -349,9 +349,9 @@ class CastSocketTest : public testing::Test {
: logger_(new Logger( : logger_(new Logger(
scoped_ptr<base::TickClock>(new base::SimpleTestTickClock), scoped_ptr<base::TickClock>(new base::SimpleTestTickClock),
base::TimeTicks())) {} base::TimeTicks())) {}
virtual ~CastSocketTest() {} ~CastSocketTest() override {}
virtual void SetUp() override { void SetUp() override {
// Create a few test messages // Create a few test messages
for (size_t i = 0; i < arraysize(test_messages_); i++) { for (size_t i = 0; i < arraysize(test_messages_); i++) {
CreateStringMessage("urn:cast", "1", "2", kTestData[i], CreateStringMessage("urn:cast", "1", "2", kTestData[i],
...@@ -363,7 +363,7 @@ class CastSocketTest : public testing::Test { ...@@ -363,7 +363,7 @@ class CastSocketTest : public testing::Test {
} }
} }
virtual void TearDown() override { void TearDown() override {
if (socket_.get()) { if (socket_.get()) {
EXPECT_CALL(handler_, OnCloseComplete(net::OK)); EXPECT_CALL(handler_, OnCloseComplete(net::OK));
socket_->Close(base::Bind(&CompleteHandler::OnCloseComplete, socket_->Close(base::Bind(&CompleteHandler::OnCloseComplete,
......
...@@ -180,7 +180,7 @@ class CastTransportTest : public testing::Test { ...@@ -180,7 +180,7 @@ class CastTransportTest : public testing::Test {
base::TimeTicks())) { base::TimeTicks())) {
transport_.reset(new CastTransport(&mock_socket_, &delegate_, logger_)); transport_.reset(new CastTransport(&mock_socket_, &delegate_, logger_));
} }
virtual ~CastTransportTest() {} ~CastTransportTest() override {}
protected: protected:
MockCastTransportDelegate delegate_; MockCastTransportDelegate delegate_;
......
...@@ -30,7 +30,7 @@ class CastChannelLoggerTest : public testing::Test { ...@@ -30,7 +30,7 @@ class CastChannelLoggerTest : public testing::Test {
: clock_(new base::SimpleTestTickClock), : clock_(new base::SimpleTestTickClock),
logger_(new Logger(scoped_ptr<base::TickClock>(clock_), logger_(new Logger(scoped_ptr<base::TickClock>(clock_),
base::TimeTicks())) {} base::TimeTicks())) {}
virtual ~CastChannelLoggerTest() {} ~CastChannelLoggerTest() override {}
bool Uncompress(const char* input, int length, std::string* output) { bool Uncompress(const char* input, int length, std::string* output) {
z_stream stream = {0}; z_stream stream = {0};
......
...@@ -142,7 +142,7 @@ class DevicePermissionsManagerFactory ...@@ -142,7 +142,7 @@ class DevicePermissionsManagerFactory
// BrowserContextKeyedServiceFactory // BrowserContextKeyedServiceFactory
KeyedService* BuildServiceInstanceFor( KeyedService* BuildServiceInstanceFor(
content::BrowserContext* context) const override; content::BrowserContext* context) const override;
virtual content::BrowserContext* GetBrowserContextToUse( content::BrowserContext* GetBrowserContextToUse(
content::BrowserContext* context) const override; content::BrowserContext* context) const override;
DISALLOW_COPY_AND_ASSIGN(DevicePermissionsManagerFactory); DISALLOW_COPY_AND_ASSIGN(DevicePermissionsManagerFactory);
......
...@@ -26,13 +26,13 @@ class DnsApiTest : public ShellApiTest { ...@@ -26,13 +26,13 @@ class DnsApiTest : public ShellApiTest {
DnsApiTest() : resolver_creator_(new MockHostResolverCreator()) {} DnsApiTest() : resolver_creator_(new MockHostResolverCreator()) {}
private: private:
virtual void SetUpOnMainThread() override { void SetUpOnMainThread() override {
ShellApiTest::SetUpOnMainThread(); ShellApiTest::SetUpOnMainThread();
HostResolverWrapper::GetInstance()->SetHostResolverForTesting( HostResolverWrapper::GetInstance()->SetHostResolverForTesting(
resolver_creator_->CreateMockHostResolver()); resolver_creator_->CreateMockHostResolver());
} }
virtual void TearDownOnMainThread() override { void TearDownOnMainThread() override {
HostResolverWrapper::GetInstance()->SetHostResolverForTesting(NULL); HostResolverWrapper::GetInstance()->SetHostResolverForTesting(NULL);
resolver_creator_->DeleteMockHostResolver(); resolver_creator_->DeleteMockHostResolver();
ShellApiTest::TearDownOnMainThread(); ShellApiTest::TearDownOnMainThread();
......
...@@ -128,12 +128,12 @@ class PowerSaveBlockerStubManager { ...@@ -128,12 +128,12 @@ class PowerSaveBlockerStubManager {
class PowerApiTest : public ApiUnitTest { class PowerApiTest : public ApiUnitTest {
public: public:
virtual void SetUp() override { void SetUp() override {
ApiUnitTest::SetUp(); ApiUnitTest::SetUp();
manager_.reset(new PowerSaveBlockerStubManager(browser_context())); manager_.reset(new PowerSaveBlockerStubManager(browser_context()));
} }
virtual void TearDown() override { void TearDown() override {
manager_.reset(); manager_.reset();
ApiUnitTest::TearDown(); ApiUnitTest::TearDown();
} }
......
...@@ -25,7 +25,7 @@ static KeyedService* ApiResourceManagerTestFactory( ...@@ -25,7 +25,7 @@ static KeyedService* ApiResourceManagerTestFactory(
class SocketsTcpUnitTest : public ApiUnitTest { class SocketsTcpUnitTest : public ApiUnitTest {
public: public:
virtual void SetUp() { void SetUp() override {
ApiUnitTest::SetUp(); ApiUnitTest::SetUp();
ApiResourceManager<ResumableTCPSocket>::GetFactoryInstance() ApiResourceManager<ResumableTCPSocket>::GetFactoryInstance()
......
...@@ -44,9 +44,7 @@ class ExtensionSettingsQuotaTest : public testing::Test { ...@@ -44,9 +44,7 @@ class ExtensionSettingsQuotaTest : public testing::Test {
ASSERT_EQ(256u, validate_sizes.size()); ASSERT_EQ(256u, validate_sizes.size());
} }
virtual void TearDown() override { void TearDown() override { ASSERT_TRUE(storage_.get() != NULL); }
ASSERT_TRUE(storage_.get() != NULL);
}
protected: protected:
// Creates |storage_|. Must only be called once. // Creates |storage_|. Must only be called once.
......
...@@ -43,7 +43,7 @@ class StorageApiUnittest : public ApiUnitTest { ...@@ -43,7 +43,7 @@ class StorageApiUnittest : public ApiUnitTest {
public: public:
StorageApiUnittest() {} StorageApiUnittest() {}
virtual void SetUp() override { void SetUp() override {
ApiUnitTest::SetUp(); ApiUnitTest::SetUp();
extensions_browser_client()->set_extension_system_factory( extensions_browser_client()->set_extension_system_factory(
&extension_system_factory_); &extension_system_factory_);
......
...@@ -44,13 +44,13 @@ class ExtensionSettingsFrontendTest : public ExtensionsTest { ...@@ -44,13 +44,13 @@ class ExtensionSettingsFrontendTest : public ExtensionsTest {
ui_thread_(BrowserThread::UI, base::MessageLoop::current()), ui_thread_(BrowserThread::UI, base::MessageLoop::current()),
file_thread_(BrowserThread::FILE, base::MessageLoop::current()) {} file_thread_(BrowserThread::FILE, base::MessageLoop::current()) {}
virtual void SetUp() override { void SetUp() override {
ExtensionsTest::SetUp(); ExtensionsTest::SetUp();
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
ResetFrontend(); ResetFrontend();
} }
virtual void TearDown() override { void TearDown() override {
frontend_.reset(); frontend_.reset();
// Execute any pending deletion tasks. // Execute any pending deletion tasks.
message_loop_.RunUntilIdle(); message_loop_.RunUntilIdle();
......
...@@ -37,7 +37,7 @@ namespace extensions { ...@@ -37,7 +37,7 @@ namespace extensions {
class ApiUnitTest : public ExtensionsTest { class ApiUnitTest : public ExtensionsTest {
public: public:
ApiUnitTest(); ApiUnitTest();
virtual ~ApiUnitTest(); ~ApiUnitTest() override;
const Extension* extension() const { return extension_.get(); } const Extension* extension() const { return extension_.get(); }
scoped_refptr<Extension> extension_ref() { return extension_; } scoped_refptr<Extension> extension_ref() { return extension_; }
...@@ -47,7 +47,7 @@ class ApiUnitTest : public ExtensionsTest { ...@@ -47,7 +47,7 @@ class ApiUnitTest : public ExtensionsTest {
protected: protected:
// SetUp creates and loads an empty, unpacked Extension. // SetUp creates and loads an empty, unpacked Extension.
virtual void SetUp() override; void SetUp() override;
// Various ways of running an API function. These methods take ownership of // Various ways of running an API function. These methods take ownership of
// |function|. |args| should be in JSON format, wrapped in a list. // |function|. |args| should be in JSON format, wrapped in a list.
......
...@@ -48,8 +48,8 @@ class AppWindowGeometryCacheTest : public ExtensionsTest { ...@@ -48,8 +48,8 @@ class AppWindowGeometryCacheTest : public ExtensionsTest {
: ui_thread_(BrowserThread::UI, &ui_message_loop_) {} : ui_thread_(BrowserThread::UI, &ui_message_loop_) {}
// testing::Test overrides: // testing::Test overrides:
virtual void SetUp() override; void SetUp() override;
virtual void TearDown() override; void TearDown() override;
void AddGeometryAndLoadExtension(const std::string& extension_id, void AddGeometryAndLoadExtension(const std::string& extension_id,
const std::string& window_id, const std::string& window_id,
......
...@@ -20,11 +20,9 @@ using error_test_util::CreateNewRuntimeError; ...@@ -20,11 +20,9 @@ using error_test_util::CreateNewRuntimeError;
class ErrorMapUnitTest : public testing::Test { class ErrorMapUnitTest : public testing::Test {
public: public:
ErrorMapUnitTest() { } ErrorMapUnitTest() { }
virtual ~ErrorMapUnitTest() { } ~ErrorMapUnitTest() override {}
virtual void SetUp() override { void SetUp() override { testing::Test::SetUp(); }
testing::Test::SetUp();
}
protected: protected:
ErrorMap errors_; ErrorMap errors_;
......
...@@ -125,7 +125,7 @@ class ExtensionIconImageTest : public ExtensionsTest, ...@@ -125,7 +125,7 @@ class ExtensionIconImageTest : public ExtensionsTest,
io_thread_(BrowserThread::IO), io_thread_(BrowserThread::IO),
notification_service_(content::NotificationService::Create()) {} notification_service_(content::NotificationService::Create()) {}
virtual ~ExtensionIconImageTest() {} ~ExtensionIconImageTest() override {}
void WaitForImageLoad() { void WaitForImageLoad() {
quit_in_image_loaded_ = true; quit_in_image_loaded_ = true;
...@@ -167,7 +167,7 @@ class ExtensionIconImageTest : public ExtensionsTest, ...@@ -167,7 +167,7 @@ class ExtensionIconImageTest : public ExtensionsTest,
} }
// testing::Test overrides: // testing::Test overrides:
virtual void SetUp() override { void SetUp() override {
file_thread_.Start(); file_thread_.Start();
io_thread_.Start(); io_thread_.Start();
} }
......
...@@ -30,7 +30,7 @@ class TestExtensionsBrowserClient; ...@@ -30,7 +30,7 @@ class TestExtensionsBrowserClient;
class ExtensionsTest : public testing::Test { class ExtensionsTest : public testing::Test {
public: public:
ExtensionsTest(); ExtensionsTest();
virtual ~ExtensionsTest(); ~ExtensionsTest() override;
// Returned as a BrowserContext since most users don't need methods from // Returned as a BrowserContext since most users don't need methods from
// TestBrowserContext. // TestBrowserContext.
...@@ -43,8 +43,8 @@ class ExtensionsTest : public testing::Test { ...@@ -43,8 +43,8 @@ class ExtensionsTest : public testing::Test {
} }
// testing::Test overrides: // testing::Test overrides:
virtual void SetUp() override; void SetUp() override;
virtual void TearDown() override; void TearDown() override;
private: private:
scoped_ptr<content::ContentClient> content_client_; scoped_ptr<content::ContentClient> content_client_;
......
...@@ -45,7 +45,7 @@ class GuestViewManagerTest : public extensions::ExtensionsTest { ...@@ -45,7 +45,7 @@ class GuestViewManagerTest : public extensions::ExtensionsTest {
public: public:
GuestViewManagerTest() : GuestViewManagerTest() :
notification_service_(content::NotificationService::Create()) {} notification_service_(content::NotificationService::Create()) {}
virtual ~GuestViewManagerTest() {} ~GuestViewManagerTest() override {}
scoped_ptr<WebContents> CreateWebContents() { scoped_ptr<WebContents> CreateWebContents() {
return scoped_ptr<WebContents>( return scoped_ptr<WebContents>(
......
...@@ -45,9 +45,7 @@ const char kTestWebSocketPort[] = "testWebSocketPort"; ...@@ -45,9 +45,7 @@ const char kTestWebSocketPort[] = "testWebSocketPort";
class EmptyHttpResponse : public net::test_server::HttpResponse { class EmptyHttpResponse : public net::test_server::HttpResponse {
public: public:
virtual std::string ToResponseString() const override { std::string ToResponseString() const override { return std::string(); }
return std::string();
}
}; };
// Handles |request| by serving a redirect response if the |User-Agent| is // Handles |request| by serving a redirect response if the |User-Agent| is
...@@ -82,7 +80,7 @@ class WebContentsHiddenObserver : public content::WebContentsObserver { ...@@ -82,7 +80,7 @@ class WebContentsHiddenObserver : public content::WebContentsObserver {
} }
// WebContentsObserver. // WebContentsObserver.
virtual void WasHidden() override { void WasHidden() override {
hidden_observed_ = true; hidden_observed_ = true;
hidden_callback_.Run(); hidden_callback_.Run();
} }
......
...@@ -41,10 +41,10 @@ class WebViewAPITest : public AppShellTest { ...@@ -41,10 +41,10 @@ class WebViewAPITest : public AppShellTest {
void SendMessageToEmbedder(const std::string& message); void SendMessageToEmbedder(const std::string& message);
// content::BrowserTestBase implementation. // content::BrowserTestBase implementation.
virtual void RunTestOnMainThreadLoop() override; void RunTestOnMainThreadLoop() override;
virtual void SetUpCommandLine(base::CommandLine* command_line) override; void SetUpCommandLine(base::CommandLine* command_line) override;
virtual void SetUpOnMainThread() override; void SetUpOnMainThread() override;
virtual void TearDownOnMainThread() override; void TearDownOnMainThread() override;
content::WebContents* embedder_web_contents_; content::WebContents* embedder_web_contents_;
TestGuestViewManagerFactory factory_; TestGuestViewManagerFactory factory_;
...@@ -56,7 +56,7 @@ class WebViewAPITest : public AppShellTest { ...@@ -56,7 +56,7 @@ class WebViewAPITest : public AppShellTest {
class WebViewDPIAPITest : public WebViewAPITest { class WebViewDPIAPITest : public WebViewAPITest {
protected: protected:
virtual void SetUp() override; void SetUp() override;
static float scale() { return 2.0f; } static float scale() { return 2.0f; }
}; };
......
...@@ -19,9 +19,9 @@ namespace { ...@@ -19,9 +19,9 @@ namespace {
class MockWebContentsDelegate : public content::WebContentsDelegate { class MockWebContentsDelegate : public content::WebContentsDelegate {
public: public:
MockWebContentsDelegate() : requested_(false), checked_(false) {} MockWebContentsDelegate() : requested_(false), checked_(false) {}
virtual ~MockWebContentsDelegate() {} ~MockWebContentsDelegate() override {}
virtual void RequestMediaAccessPermission( void RequestMediaAccessPermission(
content::WebContents* web_contents, content::WebContents* web_contents,
const content::MediaStreamRequest& request, const content::MediaStreamRequest& request,
const content::MediaResponseCallback& callback) override { const content::MediaResponseCallback& callback) override {
...@@ -30,10 +30,9 @@ class MockWebContentsDelegate : public content::WebContentsDelegate { ...@@ -30,10 +30,9 @@ class MockWebContentsDelegate : public content::WebContentsDelegate {
request_message_loop_runner_->Quit(); request_message_loop_runner_->Quit();
} }
virtual bool CheckMediaAccessPermission( bool CheckMediaAccessPermission(content::WebContents* web_contents,
content::WebContents* web_contents, const GURL& security_origin,
const GURL& security_origin, content::MediaStreamType type) override {
content::MediaStreamType type) override {
checked_ = true; checked_ = true;
if (check_message_loop_runner_.get()) if (check_message_loop_runner_.get())
check_message_loop_runner_->Quit(); check_message_loop_runner_->Quit();
...@@ -82,12 +81,12 @@ class WebViewMediaAccessAPITest : public WebViewAPITest { ...@@ -82,12 +81,12 @@ class WebViewMediaAccessAPITest : public WebViewAPITest {
} }
// content::BrowserTestBase implementation // content::BrowserTestBase implementation
virtual void SetUpOnMainThread() override { void SetUpOnMainThread() override {
WebViewAPITest::SetUpOnMainThread(); WebViewAPITest::SetUpOnMainThread();
StartTestServer(); StartTestServer();
} }
virtual void TearDownOnMainThread() override { void TearDownOnMainThread() override {
WebViewAPITest::TearDownOnMainThread(); WebViewAPITest::TearDownOnMainThread();
StopTestServer(); StopTestServer();
} }
......
...@@ -100,7 +100,7 @@ class ImageLoaderTest : public testing::Test { ...@@ -100,7 +100,7 @@ class ImageLoaderTest : public testing::Test {
gfx::ImageFamily image_family_; gfx::ImageFamily image_family_;
private: private:
virtual void SetUp() override { void SetUp() override {
testing::Test::SetUp(); testing::Test::SetUp();
file_thread_.Start(); file_thread_.Start();
io_thread_.Start(); io_thread_.Start();
......
...@@ -77,7 +77,7 @@ class LazyBackgroundTaskQueueTest : public ExtensionsTest { ...@@ -77,7 +77,7 @@ class LazyBackgroundTaskQueueTest : public ExtensionsTest {
extensions_browser_client()->set_extension_system_factory( extensions_browser_client()->set_extension_system_factory(
&extension_system_factory_); &extension_system_factory_);
} }
virtual ~LazyBackgroundTaskQueueTest() {} ~LazyBackgroundTaskQueueTest() override {}
int task_run_count() { return task_run_count_; } int task_run_count() { return task_run_count_; }
......
...@@ -12,7 +12,7 @@ using extensions::Extension; ...@@ -12,7 +12,7 @@ using extensions::Extension;
class ManagementPolicyTest : public testing::Test { class ManagementPolicyTest : public testing::Test {
public: public:
virtual void SetUp() { void SetUp() override {
allow_all_.SetProhibitedActions(TestProvider::ALLOW_ALL); allow_all_.SetProhibitedActions(TestProvider::ALLOW_ALL);
no_modify_status_.SetProhibitedActions( no_modify_status_.SetProhibitedActions(
TestProvider::PROHIBIT_MODIFY_STATUS); TestProvider::PROHIBIT_MODIFY_STATUS);
......
...@@ -19,7 +19,7 @@ class StashServiceTest : public testing::Test, public mojo::ErrorHandler { ...@@ -19,7 +19,7 @@ class StashServiceTest : public testing::Test, public mojo::ErrorHandler {
StashServiceTest() {} StashServiceTest() {}
virtual void SetUp() override { void SetUp() override {
expecting_error_ = false; expecting_error_ = false;
expected_event_ = EVENT_NONE; expected_event_ = EVENT_NONE;
stash_backend_.reset(new StashBackend); stash_backend_.reset(new StashBackend);
......
...@@ -69,7 +69,7 @@ class ProcessManagerTest : public ExtensionsTest { ...@@ -69,7 +69,7 @@ class ProcessManagerTest : public ExtensionsTest {
&process_manager_delegate_); &process_manager_delegate_);
} }
virtual ~ProcessManagerTest() {} ~ProcessManagerTest() override {}
// Use original_context() to make it clear it is a non-incognito context. // Use original_context() to make it clear it is a non-incognito context.
BrowserContext* original_context() { return browser_context(); } BrowserContext* original_context() { return browser_context(); }
......
...@@ -128,8 +128,8 @@ class QuotaServiceTest : public testing::Test { ...@@ -128,8 +128,8 @@ class QuotaServiceTest : public testing::Test {
extension_c_("c"), extension_c_("c"),
loop_(), loop_(),
ui_thread_(BrowserThread::UI, &loop_) {} ui_thread_(BrowserThread::UI, &loop_) {}
virtual void SetUp() { service_.reset(new QuotaService()); } void SetUp() override { service_.reset(new QuotaService()); }
virtual void TearDown() { void TearDown() override {
loop_.RunUntilIdle(); loop_.RunUntilIdle();
service_.reset(); service_.reset();
} }
......
...@@ -32,7 +32,7 @@ scoped_refptr<Extension> CreateExtensionWithBackgroundPage() { ...@@ -32,7 +32,7 @@ scoped_refptr<Extension> CreateExtensionWithBackgroundPage() {
class RuntimeDataTest : public testing::Test { class RuntimeDataTest : public testing::Test {
public: public:
RuntimeDataTest() : registry_(NULL), runtime_data_(&registry_) {} RuntimeDataTest() : registry_(NULL), runtime_data_(&registry_) {}
virtual ~RuntimeDataTest() {} ~RuntimeDataTest() override {}
protected: protected:
ExtensionRegistry registry_; ExtensionRegistry registry_;
......
...@@ -32,16 +32,16 @@ INSTANTIATE_TEST_CASE_P( ...@@ -32,16 +32,16 @@ INSTANTIATE_TEST_CASE_P(
class LeveldbValueStoreUnitTest : public testing::Test { class LeveldbValueStoreUnitTest : public testing::Test {
public: public:
LeveldbValueStoreUnitTest() {} LeveldbValueStoreUnitTest() {}
virtual ~LeveldbValueStoreUnitTest() {} ~LeveldbValueStoreUnitTest() override {}
protected: protected:
virtual void SetUp() override { void SetUp() override {
ASSERT_TRUE(database_dir_.CreateUniqueTempDir()); ASSERT_TRUE(database_dir_.CreateUniqueTempDir());
OpenStore(); OpenStore();
ASSERT_FALSE(store_->Get()->HasError()); ASSERT_FALSE(store_->Get()->HasError());
} }
virtual void TearDown() override { void TearDown() override {
store_->Clear(); store_->Clear();
store_.reset(); store_.reset();
} }
......
...@@ -21,7 +21,7 @@ class ValueStoreFrontendTest : public testing::Test { ...@@ -21,7 +21,7 @@ class ValueStoreFrontendTest : public testing::Test {
file_thread_(BrowserThread::FILE, base::MessageLoop::current()) { file_thread_(BrowserThread::FILE, base::MessageLoop::current()) {
} }
virtual void SetUp() { void SetUp() override {
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
base::FilePath test_data_dir; base::FilePath test_data_dir;
...@@ -33,7 +33,7 @@ class ValueStoreFrontendTest : public testing::Test { ...@@ -33,7 +33,7 @@ class ValueStoreFrontendTest : public testing::Test {
ResetStorage(); ResetStorage();
} }
virtual void TearDown() { void TearDown() override {
base::MessageLoop::current()->RunUntilIdle(); // wait for storage to delete base::MessageLoop::current()->RunUntilIdle(); // wait for storage to delete
storage_.reset(); storage_.reset();
} }
......
...@@ -24,8 +24,8 @@ class ValueStoreTest : public testing::TestWithParam<ValueStoreTestParam> { ...@@ -24,8 +24,8 @@ class ValueStoreTest : public testing::TestWithParam<ValueStoreTestParam> {
ValueStoreTest(); ValueStoreTest();
virtual ~ValueStoreTest(); virtual ~ValueStoreTest();
virtual void SetUp() override; void SetUp() override;
virtual void TearDown() override; void TearDown() override;
protected: protected:
scoped_ptr<ValueStore> storage_; scoped_ptr<ValueStore> storage_;
......
...@@ -21,7 +21,7 @@ namespace errors = externally_connectable_errors; ...@@ -21,7 +21,7 @@ namespace errors = externally_connectable_errors;
class ExternallyConnectableTest : public ManifestTest { class ExternallyConnectableTest : public ManifestTest {
public: public:
ExternallyConnectableTest() {} ExternallyConnectableTest() {}
virtual ~ExternallyConnectableTest() {} ~ExternallyConnectableTest() override {}
protected: protected:
ExternallyConnectableInfo* GetExternallyConnectableInfo( ExternallyConnectableInfo* GetExternallyConnectableInfo(
......
...@@ -22,7 +22,7 @@ namespace extensions { ...@@ -22,7 +22,7 @@ namespace extensions {
class ManifestTest : public testing::Test { class ManifestTest : public testing::Test {
public: public:
ManifestTest(); ManifestTest();
virtual ~ManifestTest(); ~ManifestTest() override;
protected: protected:
// Helper class that simplifies creating methods that take either a filename // Helper class that simplifies creating methods that take either a filename
......
...@@ -47,7 +47,7 @@ class NativeAppWindowViews : public extensions::NativeAppWindow, ...@@ -47,7 +47,7 @@ class NativeAppWindowViews : public extensions::NativeAppWindow,
public views::WidgetObserver { public views::WidgetObserver {
public: public:
NativeAppWindowViews(); NativeAppWindowViews();
virtual ~NativeAppWindowViews(); ~NativeAppWindowViews() override;
void Init(extensions::AppWindow* app_window, void Init(extensions::AppWindow* app_window,
const extensions::AppWindow::CreateParams& create_params); const extensions::AppWindow::CreateParams& create_params);
...@@ -73,103 +73,97 @@ class NativeAppWindowViews : public extensions::NativeAppWindow, ...@@ -73,103 +73,97 @@ class NativeAppWindowViews : public extensions::NativeAppWindow,
const extensions::AppWindow::CreateParams& create_params); const extensions::AppWindow::CreateParams& create_params);
// ui::BaseWindow implementation. // ui::BaseWindow implementation.
virtual bool IsActive() const override; bool IsActive() const override;
virtual bool IsMaximized() const override; bool IsMaximized() const override;
virtual bool IsMinimized() const override; bool IsMinimized() const override;
virtual bool IsFullscreen() const override; bool IsFullscreen() const override;
virtual gfx::NativeWindow GetNativeWindow() override; gfx::NativeWindow GetNativeWindow() override;
virtual gfx::Rect GetRestoredBounds() const override; gfx::Rect GetRestoredBounds() const override;
virtual ui::WindowShowState GetRestoredState() const override; ui::WindowShowState GetRestoredState() const override;
virtual gfx::Rect GetBounds() const override; gfx::Rect GetBounds() const override;
virtual void Show() override; void Show() override;
virtual void ShowInactive() override; void ShowInactive() override;
virtual void Hide() override; void Hide() override;
virtual void Close() override; void Close() override;
virtual void Activate() override; void Activate() override;
virtual void Deactivate() override; void Deactivate() override;
virtual void Maximize() override; void Maximize() override;
virtual void Minimize() override; void Minimize() override;
virtual void Restore() override; void Restore() override;
virtual void SetBounds(const gfx::Rect& bounds) override; void SetBounds(const gfx::Rect& bounds) override;
virtual void FlashFrame(bool flash) override; void FlashFrame(bool flash) override;
virtual bool IsAlwaysOnTop() const override; bool IsAlwaysOnTop() const override;
virtual void SetAlwaysOnTop(bool always_on_top) override; void SetAlwaysOnTop(bool always_on_top) override;
// WidgetDelegate implementation. // WidgetDelegate implementation.
virtual void OnWidgetMove() override; void OnWidgetMove() override;
virtual views::View* GetInitiallyFocusedView() override; views::View* GetInitiallyFocusedView() override;
virtual bool CanResize() const override; bool CanResize() const override;
virtual bool CanMaximize() const override; bool CanMaximize() const override;
virtual bool CanMinimize() const override; bool CanMinimize() const override;
virtual base::string16 GetWindowTitle() const override; base::string16 GetWindowTitle() const override;
virtual bool ShouldShowWindowTitle() const override; bool ShouldShowWindowTitle() const override;
virtual bool ShouldShowWindowIcon() const override; bool ShouldShowWindowIcon() const override;
virtual void SaveWindowPlacement(const gfx::Rect& bounds, void SaveWindowPlacement(const gfx::Rect& bounds,
ui::WindowShowState show_state) override; ui::WindowShowState show_state) override;
virtual void DeleteDelegate() override; void DeleteDelegate() override;
virtual views::Widget* GetWidget() override; views::Widget* GetWidget() override;
virtual const views::Widget* GetWidget() const override; const views::Widget* GetWidget() const override;
virtual views::View* GetContentsView() override; views::View* GetContentsView() override;
virtual bool ShouldDescendIntoChildForEventHandling( bool ShouldDescendIntoChildForEventHandling(
gfx::NativeView child, gfx::NativeView child,
const gfx::Point& location) override; const gfx::Point& location) override;
// WidgetObserver implementation. // WidgetObserver implementation.
virtual void OnWidgetVisibilityChanged(views::Widget* widget, void OnWidgetVisibilityChanged(views::Widget* widget, bool visible) override;
bool visible) override; void OnWidgetActivationChanged(views::Widget* widget, bool active) override;
virtual void OnWidgetActivationChanged(views::Widget* widget,
bool active) override;
// WebContentsObserver implementation. // WebContentsObserver implementation.
virtual void RenderViewCreated( void RenderViewCreated(content::RenderViewHost* render_view_host) override;
content::RenderViewHost* render_view_host) override; void RenderViewHostChanged(content::RenderViewHost* old_host,
virtual void RenderViewHostChanged( content::RenderViewHost* new_host) override;
content::RenderViewHost* old_host,
content::RenderViewHost* new_host) override;
// views::View implementation. // views::View implementation.
virtual void Layout() override; void Layout() override;
virtual void ViewHierarchyChanged( void ViewHierarchyChanged(
const ViewHierarchyChangedDetails& details) override; const ViewHierarchyChangedDetails& details) override;
virtual gfx::Size GetMinimumSize() const override; gfx::Size GetMinimumSize() const override;
virtual gfx::Size GetMaximumSize() const override; gfx::Size GetMaximumSize() const override;
virtual void OnFocus() override; void OnFocus() override;
// NativeAppWindow implementation. // NativeAppWindow implementation.
virtual void SetFullscreen(int fullscreen_types) override; void SetFullscreen(int fullscreen_types) override;
virtual bool IsFullscreenOrPending() const override; bool IsFullscreenOrPending() const override;
virtual void UpdateWindowIcon() override; void UpdateWindowIcon() override;
virtual void UpdateWindowTitle() override; void UpdateWindowTitle() override;
virtual void UpdateBadgeIcon() override; void UpdateBadgeIcon() override;
virtual void UpdateDraggableRegions( void UpdateDraggableRegions(
const std::vector<extensions::DraggableRegion>& regions) override; const std::vector<extensions::DraggableRegion>& regions) override;
virtual SkRegion* GetDraggableRegion() override; SkRegion* GetDraggableRegion() override;
virtual void UpdateShape(scoped_ptr<SkRegion> region) override; void UpdateShape(scoped_ptr<SkRegion> region) override;
virtual void HandleKeyboardEvent( void HandleKeyboardEvent(
const content::NativeWebKeyboardEvent& event) override; const content::NativeWebKeyboardEvent& event) override;
virtual bool IsFrameless() const override; bool IsFrameless() const override;
virtual bool HasFrameColor() const override; bool HasFrameColor() const override;
virtual SkColor ActiveFrameColor() const override; SkColor ActiveFrameColor() const override;
virtual SkColor InactiveFrameColor() const override; SkColor InactiveFrameColor() const override;
virtual gfx::Insets GetFrameInsets() const override; gfx::Insets GetFrameInsets() const override;
virtual void HideWithApp() override; void HideWithApp() override;
virtual void ShowWithApp() override; void ShowWithApp() override;
virtual void UpdateShelfMenu() override; void UpdateShelfMenu() override;
virtual gfx::Size GetContentMinimumSize() const override; gfx::Size GetContentMinimumSize() const override;
virtual gfx::Size GetContentMaximumSize() const override; gfx::Size GetContentMaximumSize() const override;
virtual void SetContentSizeConstraints(const gfx::Size& min_size, void SetContentSizeConstraints(const gfx::Size& min_size,
const gfx::Size& max_size) override; const gfx::Size& max_size) override;
virtual bool CanHaveAlphaEnabled() const override; bool CanHaveAlphaEnabled() const override;
virtual void SetVisibleOnAllWorkspaces(bool always_visible) override; void SetVisibleOnAllWorkspaces(bool always_visible) override;
// web_modal::WebContentsModalDialogHost implementation. // web_modal::WebContentsModalDialogHost implementation.
virtual gfx::NativeView GetHostView() const override; gfx::NativeView GetHostView() const override;
virtual gfx::Point GetDialogPosition(const gfx::Size& size) override; gfx::Point GetDialogPosition(const gfx::Size& size) override;
virtual gfx::Size GetMaximumDialogSize() override; gfx::Size GetMaximumDialogSize() override;
virtual void AddObserver( void AddObserver(web_modal::ModalDialogHostObserver* observer) override;
web_modal::ModalDialogHostObserver* observer) override; void RemoveObserver(web_modal::ModalDialogHostObserver* observer) override;
virtual void RemoveObserver(
web_modal::ModalDialogHostObserver* observer) override;
private: private:
// Informs modal dialogs that they need to update their positions. // Informs modal dialogs that they need to update their positions.
......
...@@ -23,7 +23,7 @@ class ActivityLogConverterStrategyTest : public testing::Test { ...@@ -23,7 +23,7 @@ class ActivityLogConverterStrategyTest : public testing::Test {
} }
protected: protected:
virtual void SetUp() { void SetUp() override {
converter_.reset(V8ValueConverter::create()); converter_.reset(V8ValueConverter::create());
strategy_.reset(new ActivityLogConverterStrategy()); strategy_.reset(new ActivityLogConverterStrategy());
converter_->SetFunctionAllowed(true); converter_->SetFunctionAllowed(true);
......
...@@ -16,7 +16,7 @@ class DataReceiverTest : public ApiTestBase { ...@@ -16,7 +16,7 @@ class DataReceiverTest : public ApiTestBase {
public: public:
DataReceiverTest() {} DataReceiverTest() {}
virtual void SetUp() override { void SetUp() override {
ApiTestBase::SetUp(); ApiTestBase::SetUp();
env()->RegisterModule("async_waiter", IDR_ASYNC_WAITER_JS); env()->RegisterModule("async_waiter", IDR_ASYNC_WAITER_JS);
env()->RegisterModule("data_receiver", IDR_DATA_RECEIVER_JS); env()->RegisterModule("data_receiver", IDR_DATA_RECEIVER_JS);
...@@ -28,7 +28,7 @@ class DataReceiverTest : public ApiTestBase { ...@@ -28,7 +28,7 @@ class DataReceiverTest : public ApiTestBase {
&DataReceiverTest::CreateDataSource, base::Unretained(this))); &DataReceiverTest::CreateDataSource, base::Unretained(this)));
} }
virtual void TearDown() override { void TearDown() override {
if (sender_.get()) { if (sender_.get()) {
sender_->ShutDown(); sender_->ShutDown();
sender_ = NULL; sender_ = NULL;
......
...@@ -16,7 +16,7 @@ class DataSenderTest : public ApiTestBase { ...@@ -16,7 +16,7 @@ class DataSenderTest : public ApiTestBase {
public: public:
DataSenderTest() {} DataSenderTest() {}
virtual void SetUp() override { void SetUp() override {
ApiTestBase::SetUp(); ApiTestBase::SetUp();
env()->RegisterModule("async_waiter", IDR_ASYNC_WAITER_JS); env()->RegisterModule("async_waiter", IDR_ASYNC_WAITER_JS);
env()->RegisterModule("data_sender", IDR_DATA_SENDER_JS); env()->RegisterModule("data_sender", IDR_DATA_SENDER_JS);
...@@ -28,7 +28,7 @@ class DataSenderTest : public ApiTestBase { ...@@ -28,7 +28,7 @@ class DataSenderTest : public ApiTestBase {
base::Bind(&DataSenderTest::CreateDataSink, base::Unretained(this))); base::Bind(&DataSenderTest::CreateDataSink, base::Unretained(this)));
} }
virtual void TearDown() override { void TearDown() override {
if (receiver_.get()) { if (receiver_.get()) {
receiver_->ShutDown(); receiver_->ShutDown();
receiver_ = NULL; receiver_ = NULL;
......
...@@ -394,7 +394,7 @@ class SerialApiTest : public ApiTestBase { ...@@ -394,7 +394,7 @@ class SerialApiTest : public ApiTestBase {
public: public:
SerialApiTest() {} SerialApiTest() {}
virtual void SetUp() override { void SetUp() override {
ApiTestBase::SetUp(); ApiTestBase::SetUp();
env()->RegisterModule("async_waiter", IDR_ASYNC_WAITER_JS); env()->RegisterModule("async_waiter", IDR_ASYNC_WAITER_JS);
env()->RegisterModule("data_receiver", IDR_DATA_RECEIVER_JS); env()->RegisterModule("data_receiver", IDR_DATA_RECEIVER_JS);
......
...@@ -72,8 +72,8 @@ class TestServiceProvider : public gin::Wrappable<TestServiceProvider> { ...@@ -72,8 +72,8 @@ class TestServiceProvider : public gin::Wrappable<TestServiceProvider> {
class ApiTestBase : public ModuleSystemTest { class ApiTestBase : public ModuleSystemTest {
protected: protected:
ApiTestBase(); ApiTestBase();
virtual ~ApiTestBase(); ~ApiTestBase() override;
virtual void SetUp() override; void SetUp() override;
void RunTest(const std::string& file_name, const std::string& test_name); void RunTest(const std::string& file_name, const std::string& test_name);
TestServiceProvider* service_provider() { return service_provider_; } TestServiceProvider* service_provider() { return service_provider_; }
......
...@@ -8,7 +8,7 @@ namespace extensions { ...@@ -8,7 +8,7 @@ namespace extensions {
class ApiTestBaseTest : public ApiTestBase { class ApiTestBaseTest : public ApiTestBase {
public: public:
virtual void SetUp() override { ApiTestBase::SetUp(); } void SetUp() override { ApiTestBase::SetUp(); }
}; };
TEST_F(ApiTestBaseTest, TestEnvironment) { TEST_F(ApiTestBaseTest, TestEnvironment) {
......
...@@ -10,7 +10,7 @@ namespace extensions { ...@@ -10,7 +10,7 @@ namespace extensions {
namespace { namespace {
class EventUnittest : public ModuleSystemTest { class EventUnittest : public ModuleSystemTest {
virtual void SetUp() override { void SetUp() override {
ModuleSystemTest::SetUp(); ModuleSystemTest::SetUp();
env()->RegisterModule(kEventBindings, IDR_EVENT_BINDINGS_JS); env()->RegisterModule(kEventBindings, IDR_EVENT_BINDINGS_JS);
......
...@@ -10,7 +10,7 @@ namespace extensions { ...@@ -10,7 +10,7 @@ namespace extensions {
class JsonSchemaTest : public ModuleSystemTest { class JsonSchemaTest : public ModuleSystemTest {
public: public:
virtual void SetUp() override { void SetUp() override {
ModuleSystemTest::SetUp(); ModuleSystemTest::SetUp();
env()->RegisterModule("json_schema", IDR_JSON_SCHEMA_JS); env()->RegisterModule("json_schema", IDR_JSON_SCHEMA_JS);
......
...@@ -24,7 +24,7 @@ class MessagingUtilsUnittest : public ModuleSystemTest { ...@@ -24,7 +24,7 @@ class MessagingUtilsUnittest : public ModuleSystemTest {
} }
private: private:
virtual void SetUp() override { void SetUp() override {
ModuleSystemTest::SetUp(); ModuleSystemTest::SetUp();
env()->RegisterModule("messaging_utils", IDR_MESSAGING_UTILS_JS); env()->RegisterModule("messaging_utils", IDR_MESSAGING_UTILS_JS);
......
...@@ -79,10 +79,10 @@ class ModuleSystemTestEnvironment { ...@@ -79,10 +79,10 @@ class ModuleSystemTestEnvironment {
class ModuleSystemTest : public testing::Test { class ModuleSystemTest : public testing::Test {
public: public:
ModuleSystemTest(); ModuleSystemTest();
virtual ~ModuleSystemTest(); ~ModuleSystemTest() override;
virtual void SetUp() override; void SetUp() override;
virtual void TearDown() override; void TearDown() override;
protected: protected:
ModuleSystemTestEnvironment* env() { return env_.get(); } ModuleSystemTestEnvironment* env() { return env_.get(); }
......
...@@ -12,7 +12,7 @@ namespace { ...@@ -12,7 +12,7 @@ namespace {
class UtilsUnittest : public ModuleSystemTest { class UtilsUnittest : public ModuleSystemTest {
private: private:
virtual void SetUp() override { void SetUp() override {
ModuleSystemTest::SetUp(); ModuleSystemTest::SetUp();
env()->RegisterModule("utils", IDR_UTILS_JS); env()->RegisterModule("utils", IDR_UTILS_JS);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment