OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/ui/views/translate/translate_bubble_view.h" | 5 #include "chrome/browser/ui/views/translate/translate_bubble_view.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
10 #include "chrome/browser/translate/cld_data_harness.h" | 10 #include "chrome/browser/translate/cld_data_harness.h" |
| 11 #include "chrome/browser/translate/cld_data_harness_factory.h" |
11 #include "chrome/browser/ui/browser.h" | 12 #include "chrome/browser/ui/browser.h" |
12 #include "chrome/browser/ui/browser_commands.h" | 13 #include "chrome/browser/ui/browser_commands.h" |
13 #include "chrome/browser/ui/browser_tabstrip.h" | 14 #include "chrome/browser/ui/browser_tabstrip.h" |
14 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 15 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
15 #include "chrome/common/chrome_switches.h" | 16 #include "chrome/common/chrome_switches.h" |
16 #include "chrome/test/base/in_process_browser_test.h" | 17 #include "chrome/test/base/in_process_browser_test.h" |
17 #include "chrome/test/base/ui_test_utils.h" | 18 #include "chrome/test/base/ui_test_utils.h" |
18 #include "components/translate/core/common/language_detection_details.h" | 19 #include "components/translate/core/common/language_detection_details.h" |
19 #include "content/public/browser/notification_details.h" | 20 #include "content/public/browser/notification_details.h" |
20 | 21 |
21 class TranslateBubbleViewBrowserTest : public InProcessBrowserTest { | 22 class TranslateBubbleViewBrowserTest : public InProcessBrowserTest { |
22 public: | 23 public: |
23 TranslateBubbleViewBrowserTest() | 24 TranslateBubbleViewBrowserTest(): |
24 : cld_data_harness(test::CreateCldDataHarness()) {} | 25 cld_data_harness( |
| 26 test::CldDataHarnessFactory::Get()->CreateCldDataHarness()) {} |
25 ~TranslateBubbleViewBrowserTest() override {} | 27 ~TranslateBubbleViewBrowserTest() override {} |
26 void SetUpOnMainThread() override { | 28 void SetUpOnMainThread() override { |
27 // We can't Init() until PathService has been initialized. This happens | 29 // We can't Init() until PathService has been initialized. This happens |
28 // very late in the test fixture setup process. | 30 // very late in the test fixture setup process. |
29 cld_data_harness->Init(); | 31 cld_data_harness->Init(); |
30 InProcessBrowserTest::SetUpOnMainThread(); | 32 InProcessBrowserTest::SetUpOnMainThread(); |
31 } | 33 } |
32 | 34 |
33 private: | 35 private: |
34 scoped_ptr<test::CldDataHarness> cld_data_harness; | 36 scoped_ptr<test::CldDataHarness> cld_data_harness; |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 chrome::CloseWebContents(browser(), web_contents, false); | 117 chrome::CloseWebContents(browser(), web_contents, false); |
116 EXPECT_EQ(active_index, browser()->tab_strip_model()->active_index()); | 118 EXPECT_EQ(active_index, browser()->tab_strip_model()->active_index()); |
117 EXPECT_EQ(1, browser()->tab_strip_model()->count()); | 119 EXPECT_EQ(1, browser()->tab_strip_model()->count()); |
118 EXPECT_FALSE(TranslateBubbleView::IsShowing()); | 120 EXPECT_FALSE(TranslateBubbleView::IsShowing()); |
119 | 121 |
120 // Close the last tab. | 122 // Close the last tab. |
121 chrome::CloseWebContents(browser(), | 123 chrome::CloseWebContents(browser(), |
122 browser()->tab_strip_model()->GetActiveWebContents(), | 124 browser()->tab_strip_model()->GetActiveWebContents(), |
123 false); | 125 false); |
124 } | 126 } |
OLD | NEW |