| OLD | NEW |
| 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 23 matching lines...) Expand all Loading... |
| 34 #include "modules/indexeddb/IDBOpenDBRequest.h" | 34 #include "modules/indexeddb/IDBOpenDBRequest.h" |
| 35 #include "platform/SharedBuffer.h" | 35 #include "platform/SharedBuffer.h" |
| 36 #include "public/platform/WebIDBDatabase.h" | 36 #include "public/platform/WebIDBDatabase.h" |
| 37 #include "wtf/PassOwnPtr.h" | 37 #include "wtf/PassOwnPtr.h" |
| 38 #include <gtest/gtest.h> | 38 #include <gtest/gtest.h> |
| 39 | 39 |
| 40 using namespace WebCore; | 40 using namespace WebCore; |
| 41 | 41 |
| 42 namespace { | 42 namespace { |
| 43 | 43 |
| 44 class NullEventQueue : public EventQueue { | 44 class NullEventQueue FINAL : public EventQueue { |
| 45 public: | 45 public: |
| 46 NullEventQueue() { } | 46 NullEventQueue() { } |
| 47 virtual ~NullEventQueue() { } | 47 virtual ~NullEventQueue() { } |
| 48 virtual bool enqueueEvent(PassRefPtr<Event>) OVERRIDE { return true; } | 48 virtual bool enqueueEvent(PassRefPtr<Event>) OVERRIDE { return true; } |
| 49 virtual bool cancelEvent(Event*) OVERRIDE { return true; } | 49 virtual bool cancelEvent(Event*) OVERRIDE { return true; } |
| 50 virtual void close() OVERRIDE { } | 50 virtual void close() OVERRIDE { } |
| 51 }; | 51 }; |
| 52 | 52 |
| 53 class NullExecutionContext : public ExecutionContext, public RefCounted<NullExec
utionContext> { | 53 class NullExecutionContext FINAL : public ExecutionContext, public RefCounted<Nu
llExecutionContext> { |
| 54 public: | 54 public: |
| 55 using RefCounted<NullExecutionContext>::ref; | 55 using RefCounted<NullExecutionContext>::ref; |
| 56 using RefCounted<NullExecutionContext>::deref; | 56 using RefCounted<NullExecutionContext>::deref; |
| 57 | 57 |
| 58 virtual void refExecutionContext() OVERRIDE { ref(); } | 58 virtual void refExecutionContext() OVERRIDE { ref(); } |
| 59 virtual void derefExecutionContext() OVERRIDE { deref(); } | 59 virtual void derefExecutionContext() OVERRIDE { deref(); } |
| 60 virtual EventQueue* eventQueue() const OVERRIDE { return m_queue.get(); } | 60 virtual EventQueue* eventQueue() const OVERRIDE { return m_queue.get(); } |
| 61 | 61 |
| 62 NullExecutionContext(); | 62 NullExecutionContext(); |
| 63 private: | 63 private: |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 OwnPtr<MockWebIDBDatabase> backend = MockWebIDBDatabase::create(); | 169 OwnPtr<MockWebIDBDatabase> backend = MockWebIDBDatabase::create(); |
| 170 RefPtr<IDBOpenDBRequest> request = IDBOpenDBRequest::create(executionCon
text(), callbacks, transactionId, version); | 170 RefPtr<IDBOpenDBRequest> request = IDBOpenDBRequest::create(executionCon
text(), callbacks, transactionId, version); |
| 171 EXPECT_EQ(request->readyState(), "pending"); | 171 EXPECT_EQ(request->readyState(), "pending"); |
| 172 | 172 |
| 173 executionContext()->stopActiveDOMObjects(); | 173 executionContext()->stopActiveDOMObjects(); |
| 174 request->onSuccess(backend.release(), metadata); | 174 request->onSuccess(backend.release(), metadata); |
| 175 } | 175 } |
| 176 } | 176 } |
| 177 | 177 |
| 178 } // namespace | 178 } // namespace |
| OLD | NEW |