OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/memory/scoped_ptr.h" | 5 #include "base/memory/scoped_ptr.h" |
6 #include "base/values.h" | 6 #include "base/values.h" |
7 #include "content/common/indexed_db/indexed_db_dispatcher.h" | 7 #include "content/common/indexed_db/indexed_db_dispatcher.h" |
8 #include "content/common/indexed_db/indexed_db_key.h" | 8 #include "content/common/indexed_db/indexed_db_key.h" |
9 #include "content/public/common/serialized_script_value.h" | 9 #include "content/public/common/serialized_script_value.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| 11 #include "third_party/WebKit/Source/Platform/chromium/public/WebData.h" |
11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebExceptionCode.h" | 12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebExceptionCode.h" |
12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBCallbacks.h" | 13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBCallbacks.h" |
13 | 14 |
14 using WebKit::WebVector; | 15 using WebKit::WebVector; |
15 using WebKit::WebString; | 16 using WebKit::WebString; |
16 | 17 |
17 namespace content { | 18 namespace content { |
18 | 19 |
19 // TODO(alecflett): Reenable this test when IDB code in webkit | 20 // TODO(alecflett): Reenable this test when IDB code in webkit |
20 // enforces size limits. See http://crbug.com/160577 | 21 // enforces size limits. See http://crbug.com/160577 |
21 TEST(IndexedDBDispatcherTest, DISABLED_ValueSizeTest) { | 22 TEST(IndexedDBDispatcherTest, DISABLED_ValueSizeTest) { |
22 string16 data; | 23 string16 data; |
23 data.resize(kMaxIDBValueSizeInBytes / sizeof(char16) + 1, 'x'); | 24 data.resize(kMaxIDBValueSizeInBytes / sizeof(char16) + 1, 'x'); |
24 WebKit::WebVector<unsigned char> value; | 25 const WebKit::WebData value; |
25 const int32 ipc_dummy_id = -1; | 26 const int32 ipc_dummy_id = -1; |
26 const int64 transaction_id = 1; | 27 const int64 transaction_id = 1; |
27 const int64 object_store_id = 2; | 28 const int64 object_store_id = 2; |
28 | 29 |
29 { | 30 { |
30 IndexedDBDispatcher dispatcher; | 31 IndexedDBDispatcher dispatcher; |
31 IndexedDBKey key; | 32 IndexedDBKey key; |
32 key.SetNumber(0); | 33 key.SetNumber(0); |
33 dispatcher.RequestIDBDatabasePut( | 34 dispatcher.RequestIDBDatabasePut( |
34 ipc_dummy_id, | 35 ipc_dummy_id, |
35 transaction_id, | 36 transaction_id, |
36 object_store_id, | 37 object_store_id, |
37 &value, | 38 value, |
38 key, | 39 key, |
39 WebKit::WebIDBDatabase::AddOrUpdate, | 40 WebKit::WebIDBDatabase::AddOrUpdate, |
40 static_cast<WebKit::WebIDBCallbacks*>(NULL), | 41 static_cast<WebKit::WebIDBCallbacks*>(NULL), |
41 WebVector<long long>(), | 42 WebVector<long long>(), |
42 WebVector<WebVector<WebKit::WebIDBKey> >()); | 43 WebVector<WebVector<WebKit::WebIDBKey> >()); |
43 } | 44 } |
44 } | 45 } |
45 | 46 |
46 } // namespace content | 47 } // namespace content |
OLD | NEW |