OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/utf_string_conversions.h" | 5 #include "base/utf_string_conversions.h" |
6 #include "chrome/browser/browser_process.h" | 6 #include "chrome/browser/browser_process.h" |
7 #include "chrome/browser/browser.h" | 7 #include "chrome/browser/browser.h" |
8 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" | 8 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" |
9 #include "chrome/browser/utility_process_host.h" | 9 #include "chrome/browser/utility_process_host.h" |
10 #include "chrome/common/indexed_db_key.h" | 10 #include "chrome/common/indexed_db_key.h" |
11 #include "chrome/common/serialized_script_value.h" | 11 #include "chrome/common/serialized_script_value.h" |
12 #include "chrome/test/in_process_browser_test.h" | 12 #include "chrome/test/in_process_browser_test.h" |
13 #include "chrome/test/ui_test_utils.h" | 13 #include "chrome/test/ui_test_utils.h" |
14 #include "googleurl/src/gurl.h" | 14 #include "googleurl/src/gurl.h" |
15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
16 #include "webkit/glue/idb_bindings.h" | 16 #include "webkit/glue/idb_bindings.h" |
| 17 #include "third_party/WebKit/WebKit/chromium/public/WebSerializedScriptValue.h" |
17 | 18 |
18 using WebKit::WebSerializedScriptValue; | 19 using WebKit::WebSerializedScriptValue; |
19 | 20 |
20 // Sanity test, check the function call directly outside the sandbox. | 21 // Sanity test, check the function call directly outside the sandbox. |
21 TEST(IDBKeyPathWithoutSandbox, Value) { | 22 TEST(IDBKeyPathWithoutSandbox, Value) { |
22 char16 data[] = {0x0353,0x6f66,0x536f,0x7a03,0x6f6f,0x017b}; | 23 char16 data[] = {0x0353,0x6f66,0x536f,0x7a03,0x6f6f,0x017b}; |
23 std::vector<WebSerializedScriptValue> serialized_values; | 24 std::vector<WebSerializedScriptValue> serialized_values; |
24 serialized_values.push_back( | 25 serialized_values.push_back( |
25 WebSerializedScriptValue::fromString(string16(data, arraysize(data)))); | 26 WebSerializedScriptValue::fromString(string16(data, arraysize(data)))); |
26 serialized_values.push_back( | 27 serialized_values.push_back( |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 // Call again with the Utility process in batch mode and with valid keys. | 261 // Call again with the Utility process in batch mode and with valid keys. |
261 expected_values.clear(); | 262 expected_values.clear(); |
262 IndexedDBKey value; | 263 IndexedDBKey value; |
263 value.Set(UTF8ToUTF16("zoo")); | 264 value.Set(UTF8ToUTF16("zoo")); |
264 expected_values.push_back(value); | 265 expected_values.push_back(value); |
265 expected_values.push_back(invalid_value); | 266 expected_values.push_back(invalid_value); |
266 scoped_helper.SetExpected(kId + 1, expected_values, false); | 267 scoped_helper.SetExpected(kId + 1, expected_values, false); |
267 scoped_helper.CheckValuesForKeyPath(kId + 1, serialized_values, | 268 scoped_helper.CheckValuesForKeyPath(kId + 1, serialized_values, |
268 UTF8ToUTF16("foo")); | 269 UTF8ToUTF16("foo")); |
269 } | 270 } |
OLD | NEW |