Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(205)

Side by Side Diff: components/autofill/browser/autofill_data_model_unittest.cc

Issue 14696007: Warn on missing OVERRIDE/virtual everywhere, not just in header files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: new regressions, attempt 3 Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "components/autofill/browser/autofill_data_model.h" 5 #include "components/autofill/browser/autofill_data_model.h"
6 6
7 #include "base/compiler_specific.h"
7 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
8 9
9 namespace autofill { 10 namespace autofill {
10 11
11 namespace { 12 namespace {
12 13
13 // Provides concrete implementations for pure virtual methods. 14 // Provides concrete implementations for pure virtual methods.
14 class TestAutofillDataModel : public AutofillDataModel { 15 class TestAutofillDataModel : public AutofillDataModel {
15 public: 16 public:
16 TestAutofillDataModel(const std::string& guid, const std::string& origin) 17 TestAutofillDataModel(const std::string& guid, const std::string& origin)
17 : AutofillDataModel(guid, origin) {} 18 : AutofillDataModel(guid, origin) {}
18 virtual ~TestAutofillDataModel() {} 19 virtual ~TestAutofillDataModel() {}
19 20
20 private: 21 private:
21 virtual base::string16 GetRawInfo(AutofillFieldType type) const { 22 virtual base::string16 GetRawInfo(AutofillFieldType type) const OVERRIDE {
22 return base::string16(); 23 return base::string16();
23 } 24 }
24 virtual void SetRawInfo(AutofillFieldType type, 25 virtual void SetRawInfo(AutofillFieldType type,
25 const base::string16& value) {} 26 const base::string16& value) OVERRIDE {}
26 virtual void GetSupportedTypes(FieldTypeSet* supported_types) const {} 27 virtual void GetSupportedTypes(
28 FieldTypeSet* supported_types) const OVERRIDE {}
27 virtual void FillFormField(const AutofillField& field, 29 virtual void FillFormField(const AutofillField& field,
28 size_t variant, 30 size_t variant,
29 const std::string& app_locale, 31 const std::string& app_locale,
30 FormFieldData* field_data) const {} 32 FormFieldData* field_data) const OVERRIDE {}
31 33
32 DISALLOW_COPY_AND_ASSIGN(TestAutofillDataModel); 34 DISALLOW_COPY_AND_ASSIGN(TestAutofillDataModel);
33 }; 35 };
34 36
35 } // namespace 37 } // namespace
36 38
37 TEST(AutofillDataModelTest, IsVerified) { 39 TEST(AutofillDataModelTest, IsVerified) {
38 TestAutofillDataModel model("guid", std::string()); 40 TestAutofillDataModel model("guid", std::string());
39 EXPECT_FALSE(model.IsVerified()); 41 EXPECT_FALSE(model.IsVerified());
40 42
(...skipping 16 matching lines...) Expand all
57 EXPECT_TRUE(model.IsVerified()); 59 EXPECT_TRUE(model.IsVerified());
58 60
59 model.set_origin("Some gibberish string"); 61 model.set_origin("Some gibberish string");
60 EXPECT_TRUE(model.IsVerified()); 62 EXPECT_TRUE(model.IsVerified());
61 63
62 model.set_origin(std::string()); 64 model.set_origin(std::string());
63 EXPECT_FALSE(model.IsVerified()); 65 EXPECT_FALSE(model.IsVerified());
64 } 66 }
65 67
66 } // namespace autofill 68 } // namespace autofill
OLDNEW
« no previous file with comments | « chromeos/ime/component_extension_ime_manager_unittest.cc ('k') | content/browser/loader/resource_dispatcher_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698