Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Side by Side Diff: chrome/browser/ui/views/translate/translate_bubble_view_browsertest.cc

Issue 461633002: Refactor language detection logic to allow non-static CLD data sources. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make some of the harness factory methods private Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_browsertest.cc ('k') | chrome/browser/ui/webui/translate_internals/translate_internals_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698