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

Side by Side Diff: extensions/renderer/bindings/binding_access_checker_unittest.cc

Issue 2947463002: [Extensions Bindings] Add a bindings/ subdirectory under renderer (Closed)
Patch Set: . 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 #include "extensions/renderer/binding_access_checker.h" 5 #include "extensions/renderer/bindings/binding_access_checker.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "extensions/renderer/api_binding_test.h" 8 #include "extensions/renderer/bindings/api_binding_test.h"
9 #include "gin/converter.h" 9 #include "gin/converter.h"
10 10
11 namespace extensions { 11 namespace extensions {
12 12
13 namespace { 13 namespace {
14 14
15 bool IsAvailable(v8::Local<v8::Context> context, const std::string& full_name) { 15 bool IsAvailable(v8::Local<v8::Context> context, const std::string& full_name) {
16 EXPECT_TRUE(full_name == "available" || full_name == "unavailable") 16 EXPECT_TRUE(full_name == "available" || full_name == "unavailable")
17 << full_name; 17 << full_name;
18 return full_name == "available"; 18 return full_name == "available";
(...skipping 28 matching lines...) Expand all
47 { 47 {
48 v8::TryCatch try_catch(isolate()); 48 v8::TryCatch try_catch(isolate());
49 EXPECT_FALSE(checker.HasAccessOrThrowError(context, "unavailable")); 49 EXPECT_FALSE(checker.HasAccessOrThrowError(context, "unavailable"));
50 ASSERT_TRUE(try_catch.HasCaught()); 50 ASSERT_TRUE(try_catch.HasCaught());
51 EXPECT_EQ("Uncaught Error: 'unavailable' is not available in this context.", 51 EXPECT_EQ("Uncaught Error: 'unavailable' is not available in this context.",
52 gin::V8ToString(try_catch.Message()->Get())); 52 gin::V8ToString(try_catch.Message()->Get()));
53 } 53 }
54 } 54 }
55 55
56 } // namespace extensions 56 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/renderer/bindings/binding_access_checker.cc ('k') | extensions/renderer/bindings/declarative_event.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698