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

Side by Side Diff: Source/WebKit/chromium/tests/IDBDatabaseBackendTest.cpp

Issue 10645009: Merge 120833 - Unreviewed build fix. (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1180/
Patch Set: Created 8 years, 6 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
« 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 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 EXPECT_TRUE(backingStore->hasOneRef()); 63 EXPECT_TRUE(backingStore->hasOneRef());
64 store.clear(); 64 store.clear();
65 EXPECT_TRUE(backingStore->hasOneRef()); 65 EXPECT_TRUE(backingStore->hasOneRef());
66 index.clear(); 66 index.clear();
67 EXPECT_TRUE(backingStore->hasOneRef()); 67 EXPECT_TRUE(backingStore->hasOneRef());
68 } 68 }
69 69
70 class MockIDBCallbacks : public IDBCallbacks { 70 class MockIDBCallbacks : public IDBCallbacks {
71 public: 71 public:
72 static PassRefPtr<MockIDBCallbacks> create() { return adoptRef(new MockIDBCa llbacks()); } 72 static PassRefPtr<MockIDBCallbacks> create() { return adoptRef(new MockIDBCa llbacks()); }
73 virtual ~MockIDBCallbacks() OVERRIDE 73 virtual ~MockIDBCallbacks()
74 { 74 {
75 EXPECT_TRUE(m_wasSuccessDBCalled); 75 EXPECT_TRUE(m_wasSuccessDBCalled);
76 } 76 }
77 virtual void onError(PassRefPtr<IDBDatabaseError>) OVERRIDE { } 77 virtual void onError(PassRefPtr<IDBDatabaseError>) OVERRIDE { }
78 virtual void onSuccess(PassRefPtr<DOMStringList>) OVERRIDE { } 78 virtual void onSuccess(PassRefPtr<DOMStringList>) OVERRIDE { }
79 virtual void onSuccess(PassRefPtr<IDBCursorBackendInterface>) OVERRIDE { } 79 virtual void onSuccess(PassRefPtr<IDBCursorBackendInterface>) OVERRIDE { }
80 virtual void onSuccess(PassRefPtr<IDBDatabaseBackendInterface>) OVERRIDE 80 virtual void onSuccess(PassRefPtr<IDBDatabaseBackendInterface>) OVERRIDE
81 { 81 {
82 m_wasSuccessDBCalled = true; 82 m_wasSuccessDBCalled = true;
83 } 83 }
84 virtual void onSuccess(PassRefPtr<IDBKey>) OVERRIDE { } 84 virtual void onSuccess(PassRefPtr<IDBKey>) OVERRIDE { }
85 virtual void onSuccess(PassRefPtr<IDBTransactionBackendInterface>) OVERRIDE { } 85 virtual void onSuccess(PassRefPtr<IDBTransactionBackendInterface>) OVERRIDE { }
86 virtual void onSuccess(PassRefPtr<SerializedScriptValue>) OVERRIDE { } 86 virtual void onSuccess(PassRefPtr<SerializedScriptValue>) OVERRIDE { }
87 virtual void onSuccessWithContinuation() OVERRIDE { } 87 virtual void onSuccessWithContinuation() OVERRIDE { }
88 virtual void onSuccessWithPrefetch(const Vector<RefPtr<IDBKey> >&, const Vec tor<RefPtr<IDBKey> >&, const Vector<RefPtr<SerializedScriptValue> >&) OVERRIDE { } 88 virtual void onSuccessWithPrefetch(const Vector<RefPtr<IDBKey> >&, const Vec tor<RefPtr<IDBKey> >&, const Vector<RefPtr<SerializedScriptValue> >&) OVERRIDE { }
89 virtual void onBlocked() OVERRIDE { } 89 virtual void onBlocked() OVERRIDE { }
90 private: 90 private:
91 MockIDBCallbacks() 91 MockIDBCallbacks()
92 : m_wasSuccessDBCalled(false) { } 92 : m_wasSuccessDBCalled(false) { }
93 bool m_wasSuccessDBCalled; 93 bool m_wasSuccessDBCalled;
94 }; 94 };
95 95
96 class FakeIDBDatabaseCallbacks : public IDBDatabaseCallbacks { 96 class FakeIDBDatabaseCallbacks : public IDBDatabaseCallbacks {
97 public: 97 public:
98 static PassRefPtr<FakeIDBDatabaseCallbacks> create() { return adoptRef(new F akeIDBDatabaseCallbacks()); } 98 static PassRefPtr<FakeIDBDatabaseCallbacks> create() { return adoptRef(new F akeIDBDatabaseCallbacks()); }
99 virtual ~FakeIDBDatabaseCallbacks() OVERRIDE { } 99 virtual ~FakeIDBDatabaseCallbacks() { }
100 virtual void onVersionChange(const String& version) OVERRIDE { } 100 virtual void onVersionChange(const String& version) OVERRIDE { }
101 private: 101 private:
102 FakeIDBDatabaseCallbacks() { } 102 FakeIDBDatabaseCallbacks() { }
103 }; 103 };
104 104
105 TEST(IDBDatabaseBackendTest, ConnectionLifecycle) 105 TEST(IDBDatabaseBackendTest, ConnectionLifecycle)
106 { 106 {
107 RefPtr<IDBFakeBackingStore> backingStore = adoptRef(new IDBFakeBackingStore( )); 107 RefPtr<IDBFakeBackingStore> backingStore = adoptRef(new IDBFakeBackingStore( ));
108 EXPECT_TRUE(backingStore->hasOneRef()); 108 EXPECT_TRUE(backingStore->hasOneRef());
109 109
(...skipping 17 matching lines...) Expand all
127 RefPtr<FakeIDBDatabaseCallbacks> connection2 = FakeIDBDatabaseCallbacks::cre ate(); 127 RefPtr<FakeIDBDatabaseCallbacks> connection2 = FakeIDBDatabaseCallbacks::cre ate();
128 db->registerFrontendCallbacks(connection2); 128 db->registerFrontendCallbacks(connection2);
129 129
130 db->close(connection2); 130 db->close(connection2);
131 EXPECT_TRUE(backingStore->hasOneRef()); 131 EXPECT_TRUE(backingStore->hasOneRef());
132 } 132 }
133 133
134 } // namespace 134 } // namespace
135 135
136 #endif // ENABLE(INDEXED_DATABASE) 136 #endif // ENABLE(INDEXED_DATABASE)
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