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 <vector> | 5 #include <vector> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 // Notifies the main thread after all history backend thread tasks have run. | 46 // Notifies the main thread after all history backend thread tasks have run. |
47 class WaitForHistoryTask : public history::HistoryDBTask { | 47 class WaitForHistoryTask : public history::HistoryDBTask { |
48 public: | 48 public: |
49 WaitForHistoryTask() {} | 49 WaitForHistoryTask() {} |
50 | 50 |
51 bool RunOnDBThread(history::HistoryBackend* backend, | 51 bool RunOnDBThread(history::HistoryBackend* backend, |
52 history::HistoryDatabase* db) override { | 52 history::HistoryDatabase* db) override { |
53 return true; | 53 return true; |
54 } | 54 } |
55 | 55 |
56 void DoneRunOnMainThread() override { base::MessageLoop::current()->Quit(); } | 56 void DoneRunOnMainThread() override { |
| 57 base::MessageLoop::current()->QuitWhenIdle(); |
| 58 } |
57 | 59 |
58 private: | 60 private: |
59 ~WaitForHistoryTask() override {} | 61 ~WaitForHistoryTask() override {} |
60 | 62 |
61 DISALLOW_COPY_AND_ASSIGN(WaitForHistoryTask); | 63 DISALLOW_COPY_AND_ASSIGN(WaitForHistoryTask); |
62 }; | 64 }; |
63 | 65 |
64 } // namespace | 66 } // namespace |
65 | 67 |
66 class HistoryBrowserTest : public InProcessBrowserTest { | 68 class HistoryBrowserTest : public InProcessBrowserTest { |
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
520 | 522 |
521 content::WebContents* active_web_contents = | 523 content::WebContents* active_web_contents = |
522 browser()->tab_strip_model()->GetActiveWebContents(); | 524 browser()->tab_strip_model()->GetActiveWebContents(); |
523 ASSERT_EQ(web_contents, active_web_contents); | 525 ASSERT_EQ(web_contents, active_web_contents); |
524 ASSERT_EQ(history_url, active_web_contents->GetURL()); | 526 ASSERT_EQ(history_url, active_web_contents->GetURL()); |
525 | 527 |
526 content::WebContents* second_tab = | 528 content::WebContents* second_tab = |
527 browser()->tab_strip_model()->GetWebContentsAt(1); | 529 browser()->tab_strip_model()->GetWebContentsAt(1); |
528 ASSERT_NE(history_url, second_tab->GetURL()); | 530 ASSERT_NE(history_url, second_tab->GetURL()); |
529 } | 531 } |
OLD | NEW |