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

Side by Side Diff: extensions/browser/api_unittest.h

Issue 685503002: Standardize usage of virtual/override/final specifiers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef EXTENSIONS_BROWSER_API_UNITTEST_H_ 5 #ifndef EXTENSIONS_BROWSER_API_UNITTEST_H_
6 #define EXTENSIONS_BROWSER_API_UNITTEST_H_ 6 #define EXTENSIONS_BROWSER_API_UNITTEST_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 19 matching lines...) Expand all
30 30
31 // Use this class to enable calling API functions in a unittest. 31 // Use this class to enable calling API functions in a unittest.
32 // By default, this class will create and load an empty unpacked |extension_|, 32 // By default, this class will create and load an empty unpacked |extension_|,
33 // which will be used in all API function calls. This extension can be 33 // which will be used in all API function calls. This extension can be
34 // overridden using set_extension(). 34 // overridden using set_extension().
35 // When calling RunFunction[AndReturn*], |args| should be in JSON format, 35 // When calling RunFunction[AndReturn*], |args| should be in JSON format,
36 // wrapped in a list. See also RunFunction* in api_test_utils.h. 36 // wrapped in a list. See also RunFunction* in api_test_utils.h.
37 class ApiUnitTest : public ExtensionsTest { 37 class ApiUnitTest : public ExtensionsTest {
38 public: 38 public:
39 ApiUnitTest(); 39 ApiUnitTest();
40 virtual ~ApiUnitTest(); 40 ~ApiUnitTest() override;
41 41
42 const Extension* extension() const { return extension_.get(); } 42 const Extension* extension() const { return extension_.get(); }
43 scoped_refptr<Extension> extension_ref() { return extension_; } 43 scoped_refptr<Extension> extension_ref() { return extension_; }
44 void set_extension(scoped_refptr<Extension> extension) { 44 void set_extension(scoped_refptr<Extension> extension) {
45 extension_ = extension; 45 extension_ = extension;
46 } 46 }
47 47
48 protected: 48 protected:
49 // SetUp creates and loads an empty, unpacked Extension. 49 // SetUp creates and loads an empty, unpacked Extension.
50 virtual void SetUp() override; 50 void SetUp() override;
51 51
52 // Various ways of running an API function. These methods take ownership of 52 // Various ways of running an API function. These methods take ownership of
53 // |function|. |args| should be in JSON format, wrapped in a list. 53 // |function|. |args| should be in JSON format, wrapped in a list.
54 // See also the RunFunction* methods in extension_function_test_utils.h. 54 // See also the RunFunction* methods in extension_function_test_utils.h.
55 55
56 // Return the function result as a base::Value. 56 // Return the function result as a base::Value.
57 scoped_ptr<base::Value> RunFunctionAndReturnValue( 57 scoped_ptr<base::Value> RunFunctionAndReturnValue(
58 UIThreadExtensionFunction* function, 58 UIThreadExtensionFunction* function,
59 const std::string& args); 59 const std::string& args);
60 60
(...skipping 26 matching lines...) Expand all
87 87
88 MockExtensionSystemFactory<MockExtensionSystem> extension_system_factory_; 88 MockExtensionSystemFactory<MockExtensionSystem> extension_system_factory_;
89 89
90 // The Extension used when running API function calls. 90 // The Extension used when running API function calls.
91 scoped_refptr<Extension> extension_; 91 scoped_refptr<Extension> extension_;
92 }; 92 };
93 93
94 } // namespace extensions 94 } // namespace extensions
95 95
96 #endif // EXTENSIONS_BROWSER_API_UNITTEST_H_ 96 #endif // EXTENSIONS_BROWSER_API_UNITTEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698