OLD | NEW |
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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/message_loop.h" | 6 #include "base/message_loop.h" |
7 #include "base/task.h" | |
8 #include "base/threading/thread.h" | 7 #include "base/threading/thread.h" |
9 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
11 #include "webkit/database/database_connections.h" | 10 #include "webkit/database/database_connections.h" |
12 | 11 |
13 namespace webkit_database { | 12 namespace webkit_database { |
14 | 13 |
15 namespace { | 14 namespace { |
16 | 15 |
17 void RemoveConnectionTask( | 16 void RemoveConnectionTask( |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 MessageLoop::current()->PostTask( | 134 MessageLoop::current()->PostTask( |
136 FROM_HERE, | 135 FROM_HERE, |
137 base::Bind(&ScheduleRemoveConnectionTask, &thread, kOriginId, kName, obj, | 136 base::Bind(&ScheduleRemoveConnectionTask, &thread, kOriginId, kName, obj, |
138 &did_task_execute)); | 137 &did_task_execute)); |
139 obj->WaitForAllDatabasesToClose(); // should return after the task executes | 138 obj->WaitForAllDatabasesToClose(); // should return after the task executes |
140 EXPECT_TRUE(did_task_execute); | 139 EXPECT_TRUE(did_task_execute); |
141 EXPECT_FALSE(obj->HasOpenConnections()); | 140 EXPECT_FALSE(obj->HasOpenConnections()); |
142 } | 141 } |
143 | 142 |
144 } // namespace webkit_database | 143 } // namespace webkit_database |
OLD | NEW |