| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |