| OLD | NEW |
| 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 #include "base/memory/scoped_ptr.h" | 5 #include "base/memory/scoped_ptr.h" |
| 6 #include "base/values.h" | 6 #include "base/values.h" |
| 7 #include "extensions/renderer/activity_log_converter_strategy.h" | 7 #include "extensions/renderer/activity_log_converter_strategy.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 #include "v8/include/v8.h" | 9 #include "v8/include/v8.h" |
| 10 | 10 |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 "big_integral_double: 9007199254740992.0," // 2.0^53 | 110 "big_integral_double: 9007199254740992.0," // 2.0^53 |
| 111 "string: \"foobar\"," | 111 "string: \"foobar\"," |
| 112 "empty_string: \"\"," | 112 "empty_string: \"\"," |
| 113 "dictionary: {" | 113 "dictionary: {" |
| 114 "foo: \"bar\"," | 114 "foo: \"bar\"," |
| 115 "hot: \"dog\"," | 115 "hot: \"dog\"," |
| 116 "}," | 116 "}," |
| 117 "empty_dictionary: {}," | 117 "empty_dictionary: {}," |
| 118 "list: [ \"monkey\", \"balls\" ]," | 118 "list: [ \"monkey\", \"balls\" ]," |
| 119 "empty_list: []," | 119 "empty_list: []," |
| 120 "function: function() {}," | 120 "function: (0, function() {})," // ensure function is anonymous |
| 121 "named_function: foo" | 121 "named_function: foo" |
| 122 "};" | 122 "};" |
| 123 "})();"; | 123 "})();"; |
| 124 | 124 |
| 125 v8::Local<v8::Script> script( | 125 v8::Local<v8::Script> script( |
| 126 v8::Script::Compile(v8::String::NewFromUtf8(isolate_, source))); | 126 v8::Script::Compile(v8::String::NewFromUtf8(isolate_, source))); |
| 127 v8::Local<v8::Object> v8_object = script->Run().As<v8::Object>(); | 127 v8::Local<v8::Object> v8_object = script->Run().As<v8::Object>(); |
| 128 | 128 |
| 129 EXPECT_TRUE(VerifyString(v8_object, "[Object]")); | 129 EXPECT_TRUE(VerifyString(v8_object, "[Object]")); |
| 130 EXPECT_TRUE( | 130 EXPECT_TRUE( |
| (...skipping 30 matching lines...) Expand all Loading... |
| 161 "[Array]")); | 161 "[Array]")); |
| 162 EXPECT_TRUE(VerifyString( | 162 EXPECT_TRUE(VerifyString( |
| 163 v8_object->Get(v8::String::NewFromUtf8(isolate_, "function")), | 163 v8_object->Get(v8::String::NewFromUtf8(isolate_, "function")), |
| 164 "[Function]")); | 164 "[Function]")); |
| 165 EXPECT_TRUE(VerifyString( | 165 EXPECT_TRUE(VerifyString( |
| 166 v8_object->Get(v8::String::NewFromUtf8(isolate_, "named_function")), | 166 v8_object->Get(v8::String::NewFromUtf8(isolate_, "named_function")), |
| 167 "[Function foo()]")); | 167 "[Function foo()]")); |
| 168 } | 168 } |
| 169 | 169 |
| 170 } // namespace extensions | 170 } // namespace extensions |
| OLD | NEW |