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

Side by Side Diff: extensions/renderer/bindings/api_bindings_system_unittest.h

Issue 2953133002: [Extensions Bindings] Support chrome.extension.lastError (Closed)
Patch Set: jbroman's, lazyboy's Created 3 years, 5 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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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_RENDERER_BINDINGS_API_BINDINGS_SYSTEM_UNITTEST_H_ 5 #ifndef EXTENSIONS_RENDERER_BINDINGS_API_BINDINGS_SYSTEM_UNITTEST_H_
6 #define EXTENSIONS_RENDERER_BINDINGS_API_BINDINGS_SYSTEM_UNITTEST_H_ 6 #define EXTENSIONS_RENDERER_BINDINGS_API_BINDINGS_SYSTEM_UNITTEST_H_
7 7
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 27 matching lines...) Expand all
38 APIBindingsSystemTest(); 38 APIBindingsSystemTest();
39 ~APIBindingsSystemTest() override; 39 ~APIBindingsSystemTest() override;
40 void SetUp() override; 40 void SetUp() override;
41 void TearDown() override; 41 void TearDown() override;
42 void OnWillDisposeContext(v8::Local<v8::Context> context) override; 42 void OnWillDisposeContext(v8::Local<v8::Context> context) override;
43 43
44 // Returns the collection of fake APIs to be used in the test, allowing 44 // Returns the collection of fake APIs to be used in the test, allowing
45 // subclasses to return their own specifications. 45 // subclasses to return their own specifications.
46 virtual std::vector<FakeSpec> GetAPIs(); 46 virtual std::vector<FakeSpec> GetAPIs();
47 47
48 // Returns the object to be used as the parent for the `lastError`. The 48 // Returns the object to be used as the parent for the `lastError`, and,
49 // default returns an empty JS object (assumes no last errors will be set). 49 // optionally, the secondary parent. The default returns an empty JS object
50 // and does not populate |secondary_parent| (assumes no last errors will be
51 // set).
50 virtual v8::Local<v8::Object> GetLastErrorParent( 52 virtual v8::Local<v8::Object> GetLastErrorParent(
51 v8::Local<v8::Context> context); 53 v8::Local<v8::Context> context,
54 v8::Local<v8::Object>* secondary_parent);
52 55
53 // Returns the DictionaryValue representing the schema with the given API 56 // Returns the DictionaryValue representing the schema with the given API
54 // name. 57 // name.
55 const base::DictionaryValue& GetAPISchema(const std::string& api_name); 58 const base::DictionaryValue& GetAPISchema(const std::string& api_name);
56 59
57 // Callback for event listeners changing. 60 // Callback for event listeners changing.
58 void OnEventListenersChanged(const std::string& event_name, 61 void OnEventListenersChanged(const std::string& event_name,
59 binding::EventListenersChanged changed, 62 binding::EventListenersChanged changed,
60 const base::DictionaryValue* filter, 63 const base::DictionaryValue* filter,
61 bool was_manual, 64 bool was_manual,
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 // The last request to be received from the APIBindingsSystem, or null if 98 // The last request to be received from the APIBindingsSystem, or null if
96 // there is none. 99 // there is none.
97 std::unique_ptr<APIRequestHandler::Request> last_request_; 100 std::unique_ptr<APIRequestHandler::Request> last_request_;
98 101
99 DISALLOW_COPY_AND_ASSIGN(APIBindingsSystemTest); 102 DISALLOW_COPY_AND_ASSIGN(APIBindingsSystemTest);
100 }; 103 };
101 104
102 } // namespace extensions 105 } // namespace extensions
103 106
104 #endif // EXTENSIONS_RENDERER_BINDINGS_API_BINDINGS_SYSTEM_UNITTEST_H_ 107 #endif // EXTENSIONS_RENDERER_BINDINGS_API_BINDINGS_SYSTEM_UNITTEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698