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

Side by Side Diff: Source/modules/indexeddb/IDBRequestTest.cpp

Issue 67463006: IndexedDB: Simplify WebIDBCallbacks exports, strip IDBFactoryBackend (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Re-up Created 7 years 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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 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 21 matching lines...) Expand all
32 #include "modules/indexeddb/IDBDatabaseCallbacks.h" 32 #include "modules/indexeddb/IDBDatabaseCallbacks.h"
33 #include "modules/indexeddb/IDBKeyRange.h" 33 #include "modules/indexeddb/IDBKeyRange.h"
34 #include "modules/indexeddb/IDBOpenDBRequest.h" 34 #include "modules/indexeddb/IDBOpenDBRequest.h"
35 #include "platform/SharedBuffer.h" 35 #include "platform/SharedBuffer.h"
36 #include "public/platform/WebIDBDatabase.h" 36 #include "public/platform/WebIDBDatabase.h"
37 #include "wtf/PassOwnPtr.h" 37 #include "wtf/PassOwnPtr.h"
38 #include <gtest/gtest.h> 38 #include <gtest/gtest.h>
39 39
40 using namespace WebCore; 40 using namespace WebCore;
41 41
42 using blink::WebData;
43 using blink::WebIDBCallbacks;
44 using blink::WebIDBDatabase;
45 using blink::WebIDBDatabaseCallbacks;
46 using blink::WebIDBKey;
47 using blink::WebIDBKeyPath;
48 using blink::WebIDBKeyRange;
49 using blink::WebString;
50 using blink::WebVector;
51
52 namespace { 42 namespace {
53 43
54 class NullEventQueue : public EventQueue { 44 class NullEventQueue : public EventQueue {
55 public: 45 public:
56 NullEventQueue() { } 46 NullEventQueue() { }
57 virtual ~NullEventQueue() { } 47 virtual ~NullEventQueue() { }
58 virtual bool enqueueEvent(PassRefPtr<Event>) OVERRIDE { return true; } 48 virtual bool enqueueEvent(PassRefPtr<Event>) OVERRIDE { return true; }
59 virtual bool cancelEvent(Event*) OVERRIDE { return true; } 49 virtual bool cancelEvent(Event*) OVERRIDE { return true; }
60 virtual void close() OVERRIDE { } 50 virtual void close() OVERRIDE { }
61 }; 51 };
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 EXPECT_EQ(request->readyState(), "pending"); 115 EXPECT_EQ(request->readyState(), "pending");
126 116
127 // Simulate the IDBTransaction having received onAbort from back end and abo rting the request: 117 // Simulate the IDBTransaction having received onAbort from back end and abo rting the request:
128 request->abort(); 118 request->abort();
129 119
130 // Now simulate the back end having fired an abort error at the request to c lear up any intermediaries. 120 // Now simulate the back end having fired an abort error at the request to c lear up any intermediaries.
131 // Ensure an assertion is not raised. 121 // Ensure an assertion is not raised.
132 request->onError(DOMError::create(AbortError, "Description goes here.")); 122 request->onError(DOMError::create(AbortError, "Description goes here."));
133 } 123 }
134 124
135 class MockWebIDBDatabase : public WebIDBDatabase { 125 class MockWebIDBDatabase : public blink::WebIDBDatabase {
136 public: 126 public:
137 static PassOwnPtr<MockWebIDBDatabase> create() 127 static PassOwnPtr<MockWebIDBDatabase> create()
138 { 128 {
139 return adoptPtr(new MockWebIDBDatabase()); 129 return adoptPtr(new MockWebIDBDatabase());
140 } 130 }
141 virtual ~MockWebIDBDatabase() 131 virtual ~MockWebIDBDatabase()
142 { 132 {
143 EXPECT_TRUE(m_closeCalled); 133 EXPECT_TRUE(m_closeCalled);
144 } 134 }
145 135
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 OwnPtr<MockWebIDBDatabase> backend = MockWebIDBDatabase::create(); 169 OwnPtr<MockWebIDBDatabase> backend = MockWebIDBDatabase::create();
180 RefPtr<IDBOpenDBRequest> request = IDBOpenDBRequest::create(executionCon text(), callbacks, transactionId, version); 170 RefPtr<IDBOpenDBRequest> request = IDBOpenDBRequest::create(executionCon text(), callbacks, transactionId, version);
181 EXPECT_EQ(request->readyState(), "pending"); 171 EXPECT_EQ(request->readyState(), "pending");
182 172
183 executionContext()->stopActiveDOMObjects(); 173 executionContext()->stopActiveDOMObjects();
184 request->onSuccess(backend.release(), metadata); 174 request->onSuccess(backend.release(), metadata);
185 } 175 }
186 } 176 }
187 177
188 } // namespace 178 } // namespace
OLDNEW
« no previous file with comments | « Source/modules/indexeddb/IDBObjectStore.cpp ('k') | Source/modules/indexeddb/IDBTransactionTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698