OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 BrowserThread::PostTaskAndReplyWithResult( | 106 BrowserThread::PostTaskAndReplyWithResult( |
107 BrowserThread::WEBKIT_DEPRECATED, FROM_HERE, | 107 BrowserThread::WEBKIT_DEPRECATED, FROM_HERE, |
108 base::Bind(&IndexedDBContext::GetOriginDiskUsage, GetContext(), | 108 base::Bind(&IndexedDBContext::GetOriginDiskUsage, GetContext(), |
109 GURL("file:///")), base::Bind( | 109 GURL("file:///")), base::Bind( |
110 &IndexedDBBrowserTest::DidGetDiskUsage, this)); | 110 &IndexedDBBrowserTest::DidGetDiskUsage, this)); |
111 scoped_refptr<base::ThreadTestHelper> helper( | 111 scoped_refptr<base::ThreadTestHelper> helper( |
112 new base::ThreadTestHelper(BrowserThread::GetMessageLoopProxyForThread( | 112 new base::ThreadTestHelper(BrowserThread::GetMessageLoopProxyForThread( |
113 BrowserThread::WEBKIT_DEPRECATED))); | 113 BrowserThread::WEBKIT_DEPRECATED))); |
114 EXPECT_TRUE(helper->Run()); | 114 EXPECT_TRUE(helper->Run()); |
115 // Wait for DidGetDiskUsage to be called. | 115 // Wait for DidGetDiskUsage to be called. |
116 MessageLoop::current()->RunUntilIdle(); | 116 base::MessageLoop::current()->RunUntilIdle(); |
117 return disk_usage_; | 117 return disk_usage_; |
118 } | 118 } |
119 private: | 119 private: |
120 virtual void DidGetDiskUsage(int64 bytes) { | 120 virtual void DidGetDiskUsage(int64 bytes) { |
121 EXPECT_GT(bytes, 0); | 121 EXPECT_GT(bytes, 0); |
122 disk_usage_ = bytes; | 122 disk_usage_ = bytes; |
123 } | 123 } |
124 | 124 |
125 int64 disk_usage_; | 125 int64 disk_usage_; |
126 }; | 126 }; |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 TitleWatcher title_watcher(new_shell->web_contents(), expected_title16); | 413 TitleWatcher title_watcher(new_shell->web_contents(), expected_title16); |
414 | 414 |
415 base::KillProcess( | 415 base::KillProcess( |
416 shell()->web_contents()->GetRenderProcessHost()->GetHandle(), 0, true); | 416 shell()->web_contents()->GetRenderProcessHost()->GetHandle(), 0, true); |
417 shell()->Close(); | 417 shell()->Close(); |
418 | 418 |
419 EXPECT_EQ(expected_title16, title_watcher.WaitAndGetTitle()); | 419 EXPECT_EQ(expected_title16, title_watcher.WaitAndGetTitle()); |
420 } | 420 } |
421 | 421 |
422 } // namespace content | 422 } // namespace content |
OLD | NEW |