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

Side by Side Diff: webkit/quota/quota_manager_unittest.cc

Issue 7067045: Disable QuotaMananger tests which rely on precise time. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 7 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 | « no previous file | no next file » | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/file_util.h" 7 #include "base/file_util.h"
8 #include "base/memory/scoped_callback_factory.h" 8 #include "base/memory/scoped_callback_factory.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 906 matching lines...) Expand 10 before | Expand all | Expand 10 after
917 MessageLoop::current()->RunAllPending(); 917 MessageLoop::current()->RunAllPending();
918 GetCachedOrigins(kStorageTypeTemporary, &origins); 918 GetCachedOrigins(kStorageTypeTemporary, &origins);
919 EXPECT_EQ(3U, origins.size()); 919 EXPECT_EQ(3U, origins.size());
920 920
921 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kData); ++i) { 921 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kData); ++i) {
922 if (kData[i].type == kStorageTypeTemporary) 922 if (kData[i].type == kStorageTypeTemporary)
923 EXPECT_TRUE(origins.find(GURL(kData[i].origin)) != origins.end()); 923 EXPECT_TRUE(origins.find(GURL(kData[i].origin)) != origins.end());
924 } 924 }
925 } 925 }
926 926
927 TEST_F(QuotaManagerTest, NotifyAndLRUOrigin) { 927 #if defined(OS_WIN)
928 // http://crbug.com/83805. Time is too granular for the LRU tests on
929 // Windows, and a new version of SQLite is returning values in a
930 // different (implementation-defined and appropriate) order.
931 #define MAYBE_NotifyAndLRUOrigin DISABLED_NotifyAndLRUOrigin
932 #define MAYBE_GetLRUOriginWithOriginInUse DISABLED_GetLRUOriginWithOriginInUse
933 #else
934 #define MAYBE_NotifyAndLRUOrigin NotifyAndLRUOrigin
935 #define MAYBE_GetLRUOriginWithOriginInUse GetLRUOriginWithOriginInUse
936 #endif
937
938 TEST_F(QuotaManagerTest, MAYBE_NotifyAndLRUOrigin) {
928 static const MockOriginData kData[] = { 939 static const MockOriginData kData[] = {
929 { "http://a.com/", kStorageTypeTemporary, 0 }, 940 { "http://a.com/", kStorageTypeTemporary, 0 },
930 { "http://a.com:1/", kStorageTypeTemporary, 0 }, 941 { "http://a.com:1/", kStorageTypeTemporary, 0 },
931 { "https://a.com/", kStorageTypeTemporary, 0 }, 942 { "https://a.com/", kStorageTypeTemporary, 0 },
932 { "http://b.com/", kStorageTypePersistent, 0 }, // persistent 943 { "http://b.com/", kStorageTypePersistent, 0 }, // persistent
933 { "http://c.com/", kStorageTypeTemporary, 0 }, 944 { "http://c.com/", kStorageTypeTemporary, 0 },
934 }; 945 };
935 MockStorageClient* client = CreateClient(kData, ARRAYSIZE_UNSAFE(kData)); 946 MockStorageClient* client = CreateClient(kData, ARRAYSIZE_UNSAFE(kData));
936 RegisterClient(client); 947 RegisterClient(client);
937 948
(...skipping 18 matching lines...) Expand all
956 GetLRUOrigin(kStorageTypeTemporary); 967 GetLRUOrigin(kStorageTypeTemporary);
957 MessageLoop::current()->RunAllPending(); 968 MessageLoop::current()->RunAllPending();
958 EXPECT_EQ("https://a.com/", lru_origin().spec()); 969 EXPECT_EQ("https://a.com/", lru_origin().spec());
959 970
960 DeleteOriginFromDatabase(lru_origin(), kStorageTypeTemporary); 971 DeleteOriginFromDatabase(lru_origin(), kStorageTypeTemporary);
961 GetLRUOrigin(kStorageTypeTemporary); 972 GetLRUOrigin(kStorageTypeTemporary);
962 MessageLoop::current()->RunAllPending(); 973 MessageLoop::current()->RunAllPending();
963 EXPECT_EQ("http://c.com/", lru_origin().spec()); 974 EXPECT_EQ("http://c.com/", lru_origin().spec());
964 } 975 }
965 976
966 TEST_F(QuotaManagerTest, GetLRUOriginWithOriginInUse) { 977 TEST_F(QuotaManagerTest, MAYBE_GetLRUOriginWithOriginInUse) {
967 static const MockOriginData kData[] = { 978 static const MockOriginData kData[] = {
968 { "http://a.com/", kStorageTypeTemporary, 0 }, 979 { "http://a.com/", kStorageTypeTemporary, 0 },
969 { "http://a.com:1/", kStorageTypeTemporary, 0 }, 980 { "http://a.com:1/", kStorageTypeTemporary, 0 },
970 { "https://a.com/", kStorageTypeTemporary, 0 }, 981 { "https://a.com/", kStorageTypeTemporary, 0 },
971 { "http://b.com/", kStorageTypePersistent, 0 }, // persistent 982 { "http://b.com/", kStorageTypePersistent, 0 }, // persistent
972 { "http://c.com/", kStorageTypeTemporary, 0 }, 983 { "http://c.com/", kStorageTypeTemporary, 0 },
973 }; 984 };
974 MockStorageClient* client = CreateClient(kData, ARRAYSIZE_UNSAFE(kData)); 985 MockStorageClient* client = CreateClient(kData, ARRAYSIZE_UNSAFE(kData));
975 RegisterClient(client); 986 RegisterClient(client);
976 987
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
1011 EXPECT_TRUE(lru_origin().is_empty()); 1022 EXPECT_TRUE(lru_origin().is_empty());
1012 1023
1013 NotifyOriginNoLongerInUse(GURL("http://a.com/")); 1024 NotifyOriginNoLongerInUse(GURL("http://a.com/"));
1014 NotifyOriginNoLongerInUse(GURL("https://a.com/")); 1025 NotifyOriginNoLongerInUse(GURL("https://a.com/"));
1015 GetLRUOrigin(kStorageTypeTemporary); 1026 GetLRUOrigin(kStorageTypeTemporary);
1016 MessageLoop::current()->RunAllPending(); 1027 MessageLoop::current()->RunAllPending();
1017 EXPECT_EQ("http://a.com/", lru_origin().spec()); 1028 EXPECT_EQ("http://a.com/", lru_origin().spec());
1018 } 1029 }
1019 1030
1020 } // namespace quota 1031 } // namespace quota
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698