OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <vector> | 5 #include <vector> |
6 | 6 |
7 #include "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/message_loop/message_loop_proxy.h" | 9 #include "base/message_loop/message_loop_proxy.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
11 #include "content/public/test/mock_special_storage_policy.h" | 11 #include "content/public/test/mock_special_storage_policy.h" |
12 #include "content/public/test/mock_storage_client.h" | 12 #include "content/public/test/mock_storage_client.h" |
13 #include "net/base/net_util.h" | 13 #include "net/base/net_util.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
15 #include "webkit/browser/quota/quota_manager.h" | 15 #include "webkit/browser/quota/quota_manager.h" |
16 #include "webkit/browser/quota/quota_manager_proxy.h" | 16 #include "webkit/browser/quota/quota_manager_proxy.h" |
17 #include "webkit/browser/quota/storage_monitor.h" | 17 #include "webkit/browser/quota/storage_monitor.h" |
18 #include "webkit/browser/quota/storage_observer.h" | 18 #include "webkit/browser/quota/storage_observer.h" |
19 | 19 |
20 using quota::HostStorageObservers; | 20 using storage::HostStorageObservers; |
21 using quota::kQuotaErrorNotSupported; | 21 using storage::kQuotaErrorNotSupported; |
22 using quota::kQuotaStatusOk; | 22 using storage::kQuotaStatusOk; |
23 using quota::kStorageTypePersistent; | 23 using storage::kStorageTypePersistent; |
24 using quota::kStorageTypeTemporary; | 24 using storage::kStorageTypeTemporary; |
25 using quota::QuotaClient; | 25 using storage::QuotaClient; |
26 using quota::QuotaManager; | 26 using storage::QuotaManager; |
27 using quota::QuotaStatusCode; | 27 using storage::QuotaStatusCode; |
28 using quota::SpecialStoragePolicy; | 28 using storage::SpecialStoragePolicy; |
29 using quota::StorageMonitor; | 29 using storage::StorageMonitor; |
30 using quota::StorageObserver; | 30 using storage::StorageObserver; |
31 using quota::StorageObserverList; | 31 using storage::StorageObserverList; |
32 using quota::StorageType; | 32 using storage::StorageType; |
33 using quota::StorageTypeObservers; | 33 using storage::StorageTypeObservers; |
34 | 34 |
35 namespace content { | 35 namespace content { |
36 | 36 |
37 namespace { | 37 namespace { |
38 | 38 |
39 const char kDefaultOrigin[] = "http://www.foo.com/"; | 39 const char kDefaultOrigin[] = "http://www.foo.com/"; |
40 const char kAlternativeOrigin[] = "http://www.bar.com/"; | 40 const char kAlternativeOrigin[] = "http://www.bar.com/"; |
41 | 41 |
42 class MockObserver : public StorageObserver { | 42 class MockObserver : public StorageObserver { |
43 public: | 43 public: |
(...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
698 base::RunLoop().RunUntilIdle(); | 698 base::RunLoop().RunUntilIdle(); |
699 | 699 |
700 // Verify that the observer receives it. | 700 // Verify that the observer receives it. |
701 ASSERT_EQ(1, mock_observer.EventCount()); | 701 ASSERT_EQ(1, mock_observer.EventCount()); |
702 const StorageObserver::Event& event = mock_observer.LastEvent(); | 702 const StorageObserver::Event& event = mock_observer.LastEvent(); |
703 EXPECT_EQ(params.filter, event.filter); | 703 EXPECT_EQ(params.filter, event.filter); |
704 EXPECT_EQ(kTestUsage, event.usage); | 704 EXPECT_EQ(kTestUsage, event.usage); |
705 } | 705 } |
706 | 706 |
707 } // namespace content | 707 } // namespace content |
OLD | NEW |