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

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

Issue 295163005: Remove ScriptState::current() from IDBRequest (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 { 85 {
86 RefPtrWillBeRawPtr<IDBKey> idbKey = checkKeyFromValueAndKeyPathInternal(isol ate, value, keyPath); 86 RefPtrWillBeRawPtr<IDBKey> idbKey = checkKeyFromValueAndKeyPathInternal(isol ate, value, keyPath);
87 ASSERT_TRUE(idbKey.get()); 87 ASSERT_TRUE(idbKey.get());
88 ASSERT_EQ(IDBKey::NumberType, idbKey->type()); 88 ASSERT_EQ(IDBKey::NumberType, idbKey->type());
89 ASSERT_TRUE(expected == idbKey->number()); 89 ASSERT_TRUE(expected == idbKey->number());
90 } 90 }
91 91
92 class IDBKeyFromValueAndKeyPathTest : public testing::Test { 92 class IDBKeyFromValueAndKeyPathTest : public testing::Test {
93 public: 93 public:
94 IDBKeyFromValueAndKeyPathTest() 94 IDBKeyFromValueAndKeyPathTest()
95 : m_scope(V8ExecutionScope::create(v8::Isolate::GetCurrent())) 95 : m_scope(V8TestingScope::create(v8::Isolate::GetCurrent()))
96 { 96 {
97 } 97 }
98 private: 98 private:
99 OwnPtr<V8ExecutionScope> m_scope; 99 OwnPtr<V8TestingScope> m_scope;
100 }; 100 };
101 101
102 TEST_F(IDBKeyFromValueAndKeyPathTest, TopLevelPropertyStringValue) 102 TEST_F(IDBKeyFromValueAndKeyPathTest, TopLevelPropertyStringValue)
103 { 103 {
104 v8::Isolate* isolate = v8::Isolate::GetCurrent(); 104 v8::Isolate* isolate = v8::Isolate::GetCurrent();
105 v8::Local<v8::Object> object = v8::Object::New(isolate); 105 v8::Local<v8::Object> object = v8::Object::New(isolate);
106 object->Set(v8AtomicString(isolate, "foo"), v8AtomicString(isolate, "zoo")); 106 object->Set(v8AtomicString(isolate, "foo"), v8AtomicString(isolate, "zoo"));
107 107
108 ScriptValue scriptValue(ScriptState::current(isolate), object); 108 ScriptValue scriptValue(ScriptState::current(isolate), object);
109 109
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 checkInjection(scriptState, IDBKey::createDate(4567), scriptObject, "foo.baz "); 169 checkInjection(scriptState, IDBKey::createDate(4567), scriptObject, "foo.baz ");
170 checkInjection(scriptState, IDBKey::createDate(4567), scriptObject, "bar"); 170 checkInjection(scriptState, IDBKey::createDate(4567), scriptObject, "bar");
171 checkInjection(scriptState, IDBKey::createArray(IDBKey::KeyArray()), scriptO bject, "foo.baz"); 171 checkInjection(scriptState, IDBKey::createArray(IDBKey::KeyArray()), scriptO bject, "foo.baz");
172 checkInjection(scriptState, IDBKey::createArray(IDBKey::KeyArray()), scriptO bject, "bar"); 172 checkInjection(scriptState, IDBKey::createArray(IDBKey::KeyArray()), scriptO bject, "bar");
173 173
174 checkInjectionFails(scriptState, IDBKey::createString("zoo"), scriptObject, "foo.bar.baz"); 174 checkInjectionFails(scriptState, IDBKey::createString("zoo"), scriptObject, "foo.bar.baz");
175 checkInjection(scriptState, IDBKey::createString("zoo"), scriptObject, "foo. xyz.foo"); 175 checkInjection(scriptState, IDBKey::createString("zoo"), scriptObject, "foo. xyz.foo");
176 } 176 }
177 177
178 } // namespace 178 } // namespace
OLDNEW
« no previous file with comments | « no previous file | Source/bindings/v8/ScriptPromiseResolverTest.cpp » ('j') | Source/bindings/v8/ScriptState.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698