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

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

Issue 1963293002: Replacing Indexed DB Chromium IPC with Mojo Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Refactoring after Passing URLRequestContextGetter. Created 4 years, 4 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
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 14 matching lines...) Expand all
25 25
26 #include "modules/indexeddb/IDBRequest.h" 26 #include "modules/indexeddb/IDBRequest.h"
27 27
28 #include "bindings/core/v8/ScriptState.h" 28 #include "bindings/core/v8/ScriptState.h"
29 #include "bindings/core/v8/V8Binding.h" 29 #include "bindings/core/v8/V8Binding.h"
30 #include "bindings/core/v8/V8BindingForTesting.h" 30 #include "bindings/core/v8/V8BindingForTesting.h"
31 #include "core/dom/DOMException.h" 31 #include "core/dom/DOMException.h"
32 #include "core/dom/ExceptionCode.h" 32 #include "core/dom/ExceptionCode.h"
33 #include "core/dom/ExecutionContext.h" 33 #include "core/dom/ExecutionContext.h"
34 #include "core/testing/NullExecutionContext.h" 34 #include "core/testing/NullExecutionContext.h"
35 #include "modules/indexeddb/IDBDatabaseCallbacks.h" 35 #include "modules/indexeddb/IDBCursorProxy.h"
36 #include "modules/indexeddb/IDBKey.h" 36 #include "modules/indexeddb/IDBKey.h"
37 #include "modules/indexeddb/IDBOpenDBRequest.h" 37 #include "modules/indexeddb/IDBOpenDBRequest.h"
38 #include "modules/indexeddb/IDBValue.h" 38 #include "modules/indexeddb/IDBValue.h"
39 #include "modules/indexeddb/MockWebIDBDatabase.h"
40 #include "platform/SharedBuffer.h" 39 #include "platform/SharedBuffer.h"
41 #include "testing/gtest/include/gtest/gtest.h" 40 #include "testing/gtest/include/gtest/gtest.h"
42 #include "wtf/PassRefPtr.h" 41 #include "wtf/PassRefPtr.h"
43 #include "wtf/Vector.h" 42 #include "wtf/Vector.h"
44 #include "wtf/dtoa/utils.h" 43 #include "wtf/dtoa/utils.h"
45 #include <memory> 44 #include <memory>
46 #include <v8.h> 45 #include <v8.h>
47 46
48 namespace blink { 47 namespace blink {
49 namespace { 48 namespace {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 // Ensure an assertion is not raised. 80 // Ensure an assertion is not raised.
82 request->onError(DOMException::create(AbortError, "Description goes here.")) ; 81 request->onError(DOMException::create(AbortError, "Description goes here.")) ;
83 82
84 // Stop the request lest it be GCed and its destructor 83 // Stop the request lest it be GCed and its destructor
85 // finds the object in a pending state (and asserts.) 84 // finds the object in a pending state (and asserts.)
86 scope.getExecutionContext()->stopActiveDOMObjects(); 85 scope.getExecutionContext()->stopActiveDOMObjects();
87 } 86 }
88 87
89 TEST(IDBRequestTest, ConnectionsAfterStopping) 88 TEST(IDBRequestTest, ConnectionsAfterStopping)
90 { 89 {
90 #if 0
91 V8TestingScope scope; 91 V8TestingScope scope;
92 const int64_t transactionId = 1234; 92 const int64_t transactionId = 1234;
93 const int64_t version = 1; 93 const int64_t version = 1;
94 const int64_t oldVersion = 0; 94 const int64_t oldVersion = 0;
95 const IDBDatabaseMetadata metadata; 95 const IDBDatabaseMetadata metadata;
96 Persistent<IDBDatabaseCallbacks> callbacks = IDBDatabaseCallbacks::create(); 96 Persistent<IDBDatabaseCallbacks> callbacks = IDBDatabaseCallbacks::create();
97 97
98 { 98 {
99 std::unique_ptr<MockWebIDBDatabase> backend = MockWebIDBDatabase::create (); 99 std::unique_ptr<MockWebIDBDatabase> backend = MockWebIDBDatabase::create ();
100 EXPECT_CALL(*backend, abort(transactionId)) 100 EXPECT_CALL(*backend, abort(transactionId))
(...skipping 10 matching lines...) Expand all
111 { 111 {
112 std::unique_ptr<MockWebIDBDatabase> backend = MockWebIDBDatabase::create (); 112 std::unique_ptr<MockWebIDBDatabase> backend = MockWebIDBDatabase::create ();
113 EXPECT_CALL(*backend, close()) 113 EXPECT_CALL(*backend, close())
114 .Times(1); 114 .Times(1);
115 IDBOpenDBRequest* request = IDBOpenDBRequest::create(scope.getScriptStat e(), callbacks, transactionId, version); 115 IDBOpenDBRequest* request = IDBOpenDBRequest::create(scope.getScriptStat e(), callbacks, transactionId, version);
116 EXPECT_EQ(request->readyState(), "pending"); 116 EXPECT_EQ(request->readyState(), "pending");
117 117
118 scope.getExecutionContext()->stopActiveDOMObjects(); 118 scope.getExecutionContext()->stopActiveDOMObjects();
119 request->onSuccess(std::move(backend), metadata); 119 request->onSuccess(std::move(backend), metadata);
120 } 120 }
121 #endif
121 } 122 }
122 123
123 } // namespace 124 } // namespace
124 } // namespace blink 125 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698