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

Side by Side Diff: Source/bindings/v8/IDBBindingUtilitiesTest.cpp

Issue 183803017: Revert of Ensure DOMWrapperWorld always exists in all webkit_unit_tests (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
OLDNEW
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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 { 86 {
87 RefPtr<IDBKey> idbKey = checkKeyFromValueAndKeyPathInternal(value, keyPath); 87 RefPtr<IDBKey> idbKey = checkKeyFromValueAndKeyPathInternal(value, keyPath);
88 ASSERT_TRUE(idbKey.get()); 88 ASSERT_TRUE(idbKey.get());
89 ASSERT_EQ(IDBKey::NumberType, idbKey->type()); 89 ASSERT_EQ(IDBKey::NumberType, idbKey->type());
90 ASSERT_TRUE(expected == idbKey->number()); 90 ASSERT_TRUE(expected == idbKey->number());
91 } 91 }
92 92
93 class IDBKeyFromValueAndKeyPathTest : public testing::Test { 93 class IDBKeyFromValueAndKeyPathTest : public testing::Test {
94 public: 94 public:
95 IDBKeyFromValueAndKeyPathTest() 95 IDBKeyFromValueAndKeyPathTest()
96 : m_scope(V8BindingTestScope::create(v8::Isolate::GetCurrent())) 96 : m_handleScope(v8::Isolate::GetCurrent())
97 , m_scope(v8::Context::New(v8::Isolate::GetCurrent()))
97 { 98 {
98 } 99 }
100
99 private: 101 private:
100 OwnPtr<V8BindingTestScope> m_scope; 102 v8::HandleScope m_handleScope;
103 v8::Context::Scope m_scope;
101 }; 104 };
102 105
103 TEST_F(IDBKeyFromValueAndKeyPathTest, TopLevelPropertyStringValue) 106 TEST_F(IDBKeyFromValueAndKeyPathTest, TopLevelPropertyStringValue)
104 { 107 {
105 v8::Isolate* isolate = v8::Isolate::GetCurrent(); 108 v8::Isolate* isolate = v8::Isolate::GetCurrent();
106 v8::Local<v8::Object> object = v8::Object::New(isolate); 109 v8::Local<v8::Object> object = v8::Object::New(isolate);
107 object->Set(v8AtomicString(isolate, "foo"), v8AtomicString(isolate, "zoo")); 110 object->Set(v8AtomicString(isolate, "foo"), v8AtomicString(isolate, "zoo"));
108 111
109 ScriptValue scriptValue(object, isolate); 112 ScriptValue scriptValue(object, isolate);
110 113
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 checkInjection(IDBKey::createDate(4567), scriptObject, "foo.baz"); 171 checkInjection(IDBKey::createDate(4567), scriptObject, "foo.baz");
169 checkInjection(IDBKey::createDate(4567), scriptObject, "bar"); 172 checkInjection(IDBKey::createDate(4567), scriptObject, "bar");
170 checkInjection(IDBKey::createArray(IDBKey::KeyArray()), scriptObject, "foo.b az"); 173 checkInjection(IDBKey::createArray(IDBKey::KeyArray()), scriptObject, "foo.b az");
171 checkInjection(IDBKey::createArray(IDBKey::KeyArray()), scriptObject, "bar") ; 174 checkInjection(IDBKey::createArray(IDBKey::KeyArray()), scriptObject, "bar") ;
172 175
173 checkInjectionFails(IDBKey::createString("zoo"), scriptObject, "foo.bar.baz" ); 176 checkInjectionFails(IDBKey::createString("zoo"), scriptObject, "foo.bar.baz" );
174 checkInjection(IDBKey::createString("zoo"), scriptObject, "foo.xyz.foo"); 177 checkInjection(IDBKey::createString("zoo"), scriptObject, "foo.xyz.foo");
175 } 178 }
176 179
177 } // namespace 180 } // namespace
OLDNEW
« no previous file with comments | « Source/bindings/v8/DOMWrapperWorld.cpp ('k') | Source/bindings/v8/ScriptPromiseResolverTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698