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

Side by Side Diff: webkit/dom_storage/dom_storage_database_unittest.cc

Issue 9718029: DomStorage commit task sequencing. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « webkit/dom_storage/dom_storage_database.cc ('k') | webkit/dom_storage/dom_storage_namespace.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "webkit/dom_storage/dom_storage_database.h" 5 #include "webkit/dom_storage/dom_storage_database.h"
6 6
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/scoped_temp_dir.h" 10 #include "base/scoped_temp_dir.h"
11 #include "base/utf_string_conversions.h" 11 #include "base/utf_string_conversions.h"
12 #include "sql/statement.h" 12 #include "sql/statement.h"
13 #include "testing/gtest/include/gtest/gtest.h" 13 #include "testing/gtest/include/gtest/gtest.h"
14 14
15 namespace dom_storage { 15 namespace dom_storage {
16 16
17 DomStorageDatabase::DomStorageDatabase() {
18 Init();
19 }
20
21 void CreateV1Table(sql::Connection* db) { 17 void CreateV1Table(sql::Connection* db) {
22 ASSERT_TRUE(db->is_open()); 18 ASSERT_TRUE(db->is_open());
23 ASSERT_TRUE(db->Execute("DROP TABLE IF EXISTS ItemTable")); 19 ASSERT_TRUE(db->Execute("DROP TABLE IF EXISTS ItemTable"));
24 ASSERT_TRUE(db->Execute( 20 ASSERT_TRUE(db->Execute(
25 "CREATE TABLE ItemTable (" 21 "CREATE TABLE ItemTable ("
26 "key TEXT UNIQUE ON CONFLICT REPLACE, " 22 "key TEXT UNIQUE ON CONFLICT REPLACE, "
27 "value TEXT NOT NULL ON CONFLICT FAIL)")); 23 "value TEXT NOT NULL ON CONFLICT FAIL)"));
28 } 24 }
29 25
30 void CreateV2Table(sql::Connection* db) { 26 void CreateV2Table(sql::Connection* db) {
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 366
371 db.ReadAllValues(&values); 367 db.ReadAllValues(&values);
372 EXPECT_EQ(0u, values.size()); 368 EXPECT_EQ(0u, values.size());
373 EXPECT_FALSE(db.IsOpen()); 369 EXPECT_FALSE(db.IsOpen());
374 370
375 EXPECT_TRUE(file_util::PathExists(temp_dir.path())); 371 EXPECT_TRUE(file_util::PathExists(temp_dir.path()));
376 } 372 }
377 } 373 }
378 374
379 } // namespace dom_storage 375 } // namespace dom_storage
OLDNEW
« no previous file with comments | « webkit/dom_storage/dom_storage_database.cc ('k') | webkit/dom_storage/dom_storage_namespace.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698