OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 12 matching lines...) Expand all Loading... |
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
24 */ | 24 */ |
25 | 25 |
26 #include "config.h" | 26 #include "config.h" |
27 #include "bindings/v8/IDBBindingUtilities.h" | 27 #include "bindings/v8/IDBBindingUtilities.h" |
28 | 28 |
29 #include "bindings/v8/V8Binding.h" | 29 #include "bindings/v8/V8Binding.h" |
30 #include "bindings/v8/V8PerIsolateData.h" | 30 #include "bindings/v8/V8PerIsolateData.h" |
31 #include "modules/indexeddb/IDBKey.h" | 31 #include "modules/indexeddb/IDBKey.h" |
32 #include "modules/indexeddb/IDBKeyPath.h" | 32 #include "modules/indexeddb/IDBKeyPath.h" |
33 | |
34 #include <gtest/gtest.h> | 33 #include <gtest/gtest.h> |
35 | 34 |
36 using namespace WebCore; | 35 using namespace WebCore; |
37 | 36 |
38 namespace { | 37 namespace { |
39 | 38 |
40 IDBKey* checkKeyFromValueAndKeyPathInternal(v8::Isolate* isolate, const ScriptVa
lue& value, const String& keyPath) | 39 IDBKey* checkKeyFromValueAndKeyPathInternal(v8::Isolate* isolate, const ScriptVa
lue& value, const String& keyPath) |
41 { | 40 { |
42 IDBKeyPath idbKeyPath(keyPath); | 41 IDBKeyPath idbKeyPath(keyPath); |
43 EXPECT_TRUE(idbKeyPath.isValid()); | 42 EXPECT_TRUE(idbKeyPath.isValid()); |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 checkInjection(scriptState, IDBKey::createDate(4567), scriptObject, "foo.baz
"); | 166 checkInjection(scriptState, IDBKey::createDate(4567), scriptObject, "foo.baz
"); |
168 checkInjection(scriptState, IDBKey::createDate(4567), scriptObject, "bar"); | 167 checkInjection(scriptState, IDBKey::createDate(4567), scriptObject, "bar"); |
169 checkInjection(scriptState, IDBKey::createArray(IDBKey::KeyArray()), scriptO
bject, "foo.baz"); | 168 checkInjection(scriptState, IDBKey::createArray(IDBKey::KeyArray()), scriptO
bject, "foo.baz"); |
170 checkInjection(scriptState, IDBKey::createArray(IDBKey::KeyArray()), scriptO
bject, "bar"); | 169 checkInjection(scriptState, IDBKey::createArray(IDBKey::KeyArray()), scriptO
bject, "bar"); |
171 | 170 |
172 checkInjectionFails(scriptState, IDBKey::createString("zoo"), scriptObject,
"foo.bar.baz"); | 171 checkInjectionFails(scriptState, IDBKey::createString("zoo"), scriptObject,
"foo.bar.baz"); |
173 checkInjection(scriptState, IDBKey::createString("zoo"), scriptObject, "foo.
xyz.foo"); | 172 checkInjection(scriptState, IDBKey::createString("zoo"), scriptObject, "foo.
xyz.foo"); |
174 } | 173 } |
175 | 174 |
176 } // namespace | 175 } // namespace |
OLD | NEW |