| 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" | |
| 8 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" | 7 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" |
| 8 #include "chrome/browser/ui/browser.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 "third_party/WebKit/WebKit/chromium/public/WebSerializedScriptValue.h" |
| 16 #include "webkit/glue/idb_bindings.h" | 17 #include "webkit/glue/idb_bindings.h" |
| 17 #include "webkit/glue/web_io_operators.h" | 18 #include "webkit/glue/web_io_operators.h" |
| 18 #include "third_party/WebKit/WebKit/chromium/public/WebSerializedScriptValue.h" | |
| 19 | 19 |
| 20 using WebKit::WebSerializedScriptValue; | 20 using WebKit::WebSerializedScriptValue; |
| 21 | 21 |
| 22 // Sanity test, check the function call directly outside the sandbox. | 22 // Sanity test, check the function call directly outside the sandbox. |
| 23 TEST(IDBKeyPathWithoutSandbox, Value) { | 23 TEST(IDBKeyPathWithoutSandbox, Value) { |
| 24 char16 data[] = {0x0353,0x6f66,0x536f,0x7a03,0x6f6f,0x017b}; | 24 char16 data[] = {0x0353,0x6f66,0x536f,0x7a03,0x6f6f,0x017b}; |
| 25 std::vector<WebSerializedScriptValue> serialized_values; | 25 std::vector<WebSerializedScriptValue> serialized_values; |
| 26 serialized_values.push_back( | 26 serialized_values.push_back( |
| 27 WebSerializedScriptValue::fromString(string16(data, arraysize(data)))); | 27 WebSerializedScriptValue::fromString(string16(data, arraysize(data)))); |
| 28 serialized_values.push_back( | 28 serialized_values.push_back( |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 // Call again with the Utility process in batch mode and with valid keys. | 262 // Call again with the Utility process in batch mode and with valid keys. |
| 263 expected_values.clear(); | 263 expected_values.clear(); |
| 264 IndexedDBKey value; | 264 IndexedDBKey value; |
| 265 value.Set(UTF8ToUTF16("zoo")); | 265 value.Set(UTF8ToUTF16("zoo")); |
| 266 expected_values.push_back(value); | 266 expected_values.push_back(value); |
| 267 expected_values.push_back(invalid_value); | 267 expected_values.push_back(invalid_value); |
| 268 scoped_helper.SetExpected(kId + 1, expected_values, false); | 268 scoped_helper.SetExpected(kId + 1, expected_values, false); |
| 269 scoped_helper.CheckValuesForKeyPath(kId + 1, serialized_values, | 269 scoped_helper.CheckValuesForKeyPath(kId + 1, serialized_values, |
| 270 UTF8ToUTF16("foo")); | 270 UTF8ToUTF16("foo")); |
| 271 } | 271 } |
| OLD | NEW |