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

Side by Side Diff: content/browser/indexed_db/indexed_db_browsertest.cc

Issue 932143003: IndexedDB: Report QuotaExceededError when commit fails due to disk full (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 // 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/bind.h" 5 #include "base/bind.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/files/file.h" 7 #include "base/files/file.h"
8 #include "base/files/file_enumerator.h" 8 #include "base/files/file_enumerator.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 FROM_HERE, base::Bind(&IndexedDBContextImpl::DeleteForOrigin, 434 FROM_HERE, base::Bind(&IndexedDBContextImpl::DeleteForOrigin,
435 GetContext(), GURL("file:///"))); 435 GetContext(), GURL("file:///")));
436 scoped_refptr<base::ThreadTestHelper> helper( 436 scoped_refptr<base::ThreadTestHelper> helper(
437 new base::ThreadTestHelper(BrowserMainLoop::GetInstance() 437 new base::ThreadTestHelper(BrowserMainLoop::GetInstance()
438 ->indexed_db_thread() 438 ->indexed_db_thread()
439 ->message_loop_proxy())); 439 ->message_loop_proxy()));
440 ASSERT_TRUE(helper->Run()); 440 ASSERT_TRUE(helper->Run());
441 EXPECT_EQ(0, RequestDiskUsage()); 441 EXPECT_EQ(0, RequestDiskUsage());
442 } 442 }
443 443
444 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, DiskFullOnCommit) {
445 const int instance_num = 7;
jsbell 2015/02/19 19:05:44 I want to document why this is 7. The test preambl
jsbell 2015/02/19 21:26:26 Done in latest PS. Also filed crbug.com/460236 to
446 const int call_num = 1;
447 FailOperation(FAIL_CLASS_LEVELDB_TRANSACTION, FAIL_METHOD_COMMIT_DISK_FULL,
448 instance_num, call_num);
449 SimpleTest(GetTestUrl("indexeddb", "disk_full_on_commit.html"));
450 }
451
444 namespace { 452 namespace {
445 453
446 static void CompactIndexedDBBackingStore( 454 static void CompactIndexedDBBackingStore(
447 scoped_refptr<IndexedDBContextImpl> context, 455 scoped_refptr<IndexedDBContextImpl> context,
448 const GURL& origin_url) { 456 const GURL& origin_url) {
449 IndexedDBFactory* factory = context->GetIDBFactory(); 457 IndexedDBFactory* factory = context->GetIDBFactory();
450 458
451 std::pair<IndexedDBFactory::OriginDBMapIterator, 459 std::pair<IndexedDBFactory::OriginDBMapIterator,
452 IndexedDBFactory::OriginDBMapIterator> range = 460 IndexedDBFactory::OriginDBMapIterator> range =
453 factory->GetOpenDatabasesForOrigin(origin_url); 461 factory->GetOpenDatabasesForOrigin(origin_url);
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
766 command_line->AppendSwitch(switches::kSingleProcess); 774 command_line->AppendSwitch(switches::kSingleProcess);
767 } 775 }
768 }; 776 };
769 777
770 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTestSingleProcess, 778 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTestSingleProcess,
771 RenderThreadShutdownTest) { 779 RenderThreadShutdownTest) {
772 SimpleTest(GetTestUrl("indexeddb", "shutdown_with_requests.html")); 780 SimpleTest(GetTestUrl("indexeddb", "shutdown_with_requests.html"));
773 } 781 }
774 782
775 } // namespace content 783 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698