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