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

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

Issue 1878153002: Revert of Simplify BrowserContext by removing redundant methods. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 content::WebContents* contents() { return contents_.get(); } 42 content::WebContents* contents() { return contents_.get(); }
43 const Extension* extension() const { return extension_.get(); } 43 const Extension* extension() const { return extension_.get(); }
44 scoped_refptr<Extension> extension_ref() { return extension_; } 44 scoped_refptr<Extension> extension_ref() { return extension_; }
45 void set_extension(scoped_refptr<Extension> extension) { 45 void set_extension(scoped_refptr<Extension> extension) {
46 extension_ = extension; 46 extension_ = extension;
47 } 47 }
48 48
49 protected: 49 protected:
50 // SetUp creates and loads an empty, unpacked Extension. 50 // SetUp creates and loads an empty, unpacked Extension.
51 void SetUp() override; 51 void SetUp() override;
52 void TearDown() override;
53 52
54 // Creates a background page for |extension_|, and sets it for the WebContents 53 // Creates a background page for |extension_|, and sets it for the WebContents
55 // to be used in API calls. 54 // to be used in API calls.
56 // If |contents_| is already set, this does nothing. 55 // If |contents_| is already set, this does nothing.
57 void CreateBackgroundPage(); 56 void CreateBackgroundPage();
58 57
59 // Various ways of running an API function. These methods take ownership of 58 // Various ways of running an API function. These methods take ownership of
60 // |function|. |args| should be in JSON format, wrapped in a list. 59 // |function|. |args| should be in JSON format, wrapped in a list.
61 // See also the RunFunction* methods in extension_function_test_utils.h. 60 // See also the RunFunction* methods in extension_function_test_utils.h.
62 61
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 // or null. 95 // or null.
97 scoped_ptr<content::WebContents> contents_; 96 scoped_ptr<content::WebContents> contents_;
98 97
99 // The Extension used when running API function calls. 98 // The Extension used when running API function calls.
100 scoped_refptr<Extension> extension_; 99 scoped_refptr<Extension> extension_;
101 }; 100 };
102 101
103 } // namespace extensions 102 } // namespace extensions
104 103
105 #endif // EXTENSIONS_BROWSER_API_UNITTEST_H_ 104 #endif // EXTENSIONS_BROWSER_API_UNITTEST_H_
OLDNEW
« no previous file with comments | « extensions/browser/api/sockets_tcp/sockets_tcp_api.cc ('k') | extensions/browser/api_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698