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

Side by Side Diff: chrome/browser/ui/browser_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 (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 <string> 5 #include <string>
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/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 13 matching lines...) Expand all
24 #include "chrome/browser/first_run/first_run.h" 24 #include "chrome/browser/first_run/first_run.h"
25 #include "chrome/browser/lifetime/application_lifetime.h" 25 #include "chrome/browser/lifetime/application_lifetime.h"
26 #include "chrome/browser/prefs/incognito_mode_prefs.h" 26 #include "chrome/browser/prefs/incognito_mode_prefs.h"
27 #include "chrome/browser/profiles/profile.h" 27 #include "chrome/browser/profiles/profile.h"
28 #include "chrome/browser/profiles/profile_manager.h" 28 #include "chrome/browser/profiles/profile_manager.h"
29 #include "chrome/browser/search/search.h" 29 #include "chrome/browser/search/search.h"
30 #include "chrome/browser/sessions/session_backend.h" 30 #include "chrome/browser/sessions/session_backend.h"
31 #include "chrome/browser/sessions/session_service_factory.h" 31 #include "chrome/browser/sessions/session_service_factory.h"
32 #include "chrome/browser/translate/chrome_translate_client.h" 32 #include "chrome/browser/translate/chrome_translate_client.h"
33 #include "chrome/browser/translate/cld_data_harness.h" 33 #include "chrome/browser/translate/cld_data_harness.h"
34 #include "chrome/browser/translate/cld_data_harness_factory.h"
34 #include "chrome/browser/ui/browser.h" 35 #include "chrome/browser/ui/browser.h"
35 #include "chrome/browser/ui/browser_command_controller.h" 36 #include "chrome/browser/ui/browser_command_controller.h"
36 #include "chrome/browser/ui/browser_commands.h" 37 #include "chrome/browser/ui/browser_commands.h"
37 #include "chrome/browser/ui/browser_finder.h" 38 #include "chrome/browser/ui/browser_finder.h"
38 #include "chrome/browser/ui/browser_iterator.h" 39 #include "chrome/browser/ui/browser_iterator.h"
39 #include "chrome/browser/ui/browser_navigator.h" 40 #include "chrome/browser/ui/browser_navigator.h"
40 #include "chrome/browser/ui/browser_tabstrip.h" 41 #include "chrome/browser/ui/browser_tabstrip.h"
41 #include "chrome/browser/ui/browser_ui_prefs.h" 42 #include "chrome/browser/ui/browser_ui_prefs.h"
42 #include "chrome/browser/ui/browser_window.h" 43 #include "chrome/browser/ui/browser_window.h"
43 #include "chrome/browser/ui/extensions/application_launch.h" 44 #include "chrome/browser/ui/extensions/application_launch.h"
(...skipping 1330 matching lines...) Expand 10 before | Expand all | Expand 10 after
1374 EXPECT_FALSE( 1375 EXPECT_FALSE(
1375 app_browser->SupportsWindowFeature(Browser::FEATURE_LOCATIONBAR)); 1376 app_browser->SupportsWindowFeature(Browser::FEATURE_LOCATIONBAR));
1376 1377
1377 DevToolsWindowTesting::CloseDevToolsWindowSync(devtools_window); 1378 DevToolsWindowTesting::CloseDevToolsWindowSync(devtools_window);
1378 } 1379 }
1379 #endif 1380 #endif
1380 1381
1381 // Tests that the CLD (Compact Language Detection) works properly. 1382 // Tests that the CLD (Compact Language Detection) works properly.
1382 IN_PROC_BROWSER_TEST_F(BrowserTest, PageLanguageDetection) { 1383 IN_PROC_BROWSER_TEST_F(BrowserTest, PageLanguageDetection) {
1383 scoped_ptr<test::CldDataHarness> cld_data_harness = 1384 scoped_ptr<test::CldDataHarness> cld_data_harness =
1384 test::CreateCldDataHarness(); 1385 test::CldDataHarnessFactory::Get()->CreateCldDataHarness();
1385 ASSERT_NO_FATAL_FAILURE(cld_data_harness->Init()); 1386 ASSERT_NO_FATAL_FAILURE(cld_data_harness->Init());
1386 ASSERT_TRUE(test_server()->Start()); 1387 ASSERT_TRUE(test_server()->Start());
1387 1388
1388 translate::LanguageDetectionDetails details; 1389 translate::LanguageDetectionDetails details;
1389 1390
1390 // Open a new tab with a page in English. 1391 // Open a new tab with a page in English.
1391 AddTabAtIndex(0, GURL(test_server()->GetURL("files/english_page.html")), 1392 AddTabAtIndex(0, GURL(test_server()->GetURL("files/english_page.html")),
1392 ui::PAGE_TRANSITION_TYPED); 1393 ui::PAGE_TRANSITION_TYPED);
1393 1394
1394 WebContents* current_web_contents = 1395 WebContents* current_web_contents =
(...skipping 1253 matching lines...) Expand 10 before | Expand all | Expand 10 after
2648 #endif 2649 #endif
2649 EXPECT_EQ(exp_commit_size, rwhv_commit_size2); 2650 EXPECT_EQ(exp_commit_size, rwhv_commit_size2);
2650 EXPECT_EQ(exp_commit_size, wcv_commit_size2); 2651 EXPECT_EQ(exp_commit_size, wcv_commit_size2);
2651 gfx::Size exp_final_size(initial_wcv_size); 2652 gfx::Size exp_final_size(initial_wcv_size);
2652 exp_final_size.Enlarge(wcv_resize_insets.width(), 2653 exp_final_size.Enlarge(wcv_resize_insets.width(),
2653 wcv_resize_insets.height() + height_inset); 2654 wcv_resize_insets.height() + height_inset);
2654 EXPECT_EQ(exp_final_size, 2655 EXPECT_EQ(exp_final_size,
2655 web_contents->GetRenderWidgetHostView()->GetViewBounds().size()); 2656 web_contents->GetRenderWidgetHostView()->GetViewBounds().size());
2656 EXPECT_EQ(exp_final_size, web_contents->GetContainerBounds().size()); 2657 EXPECT_EQ(exp_final_size, web_contents->GetContainerBounds().size());
2657 } 2658 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698