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

Side by Side Diff: chrome/browser/ui/browser_browsertest.cc

Issue 333603002: Modularize Compact Language Detector 2 (CLD2) data sources (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge https://codereview.chromium.org/326383005 Created 6 years, 5 months 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"
11 #include "base/memory/scoped_ptr.h"
11 #include "base/prefs/pref_service.h" 12 #include "base/prefs/pref_service.h"
12 #include "base/strings/utf_string_conversions.h" 13 #include "base/strings/utf_string_conversions.h"
13 #include "base/sys_info.h" 14 #include "base/sys_info.h"
14 #include "chrome/app/chrome_command_ids.h" 15 #include "chrome/app/chrome_command_ids.h"
15 #include "chrome/browser/chrome_content_browser_client.h" 16 #include "chrome/browser/chrome_content_browser_client.h"
16 #include "chrome/browser/chrome_notification_types.h" 17 #include "chrome/browser/chrome_notification_types.h"
17 #include "chrome/browser/command_updater.h" 18 #include "chrome/browser/command_updater.h"
18 #include "chrome/browser/content_settings/host_content_settings_map.h" 19 #include "chrome/browser/content_settings/host_content_settings_map.h"
19 #include "chrome/browser/defaults.h" 20 #include "chrome/browser/defaults.h"
20 #include "chrome/browser/devtools/devtools_window.h" 21 #include "chrome/browser/devtools/devtools_window.h"
21 #include "chrome/browser/extensions/extension_browsertest.h" 22 #include "chrome/browser/extensions/extension_browsertest.h"
22 #include "chrome/browser/extensions/extension_service.h" 23 #include "chrome/browser/extensions/extension_service.h"
23 #include "chrome/browser/extensions/tab_helper.h" 24 #include "chrome/browser/extensions/tab_helper.h"
24 #include "chrome/browser/first_run/first_run.h" 25 #include "chrome/browser/first_run/first_run.h"
25 #include "chrome/browser/lifetime/application_lifetime.h" 26 #include "chrome/browser/lifetime/application_lifetime.h"
26 #include "chrome/browser/prefs/incognito_mode_prefs.h" 27 #include "chrome/browser/prefs/incognito_mode_prefs.h"
27 #include "chrome/browser/profiles/profile.h" 28 #include "chrome/browser/profiles/profile.h"
28 #include "chrome/browser/profiles/profile_manager.h" 29 #include "chrome/browser/profiles/profile_manager.h"
29 #include "chrome/browser/search/search.h" 30 #include "chrome/browser/search/search.h"
30 #include "chrome/browser/sessions/session_backend.h" 31 #include "chrome/browser/sessions/session_backend.h"
31 #include "chrome/browser/sessions/session_service_factory.h" 32 #include "chrome/browser/sessions/session_service_factory.h"
32 #include "chrome/browser/translate/chrome_translate_client.h" 33 #include "chrome/browser/translate/chrome_translate_client.h"
33 #include "chrome/browser/translate/translate_browser_test_utils.h" 34 #include "chrome/browser/translate/cld_data_harness.h"
34 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog.h" 35 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog.h"
35 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog_queue.h" 36 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog_queue.h"
36 #include "chrome/browser/ui/app_modal_dialogs/javascript_app_modal_dialog.h" 37 #include "chrome/browser/ui/app_modal_dialogs/javascript_app_modal_dialog.h"
37 #include "chrome/browser/ui/app_modal_dialogs/native_app_modal_dialog.h" 38 #include "chrome/browser/ui/app_modal_dialogs/native_app_modal_dialog.h"
38 #include "chrome/browser/ui/browser.h" 39 #include "chrome/browser/ui/browser.h"
39 #include "chrome/browser/ui/browser_command_controller.h" 40 #include "chrome/browser/ui/browser_command_controller.h"
40 #include "chrome/browser/ui/browser_commands.h" 41 #include "chrome/browser/ui/browser_commands.h"
41 #include "chrome/browser/ui/browser_finder.h" 42 #include "chrome/browser/ui/browser_finder.h"
42 #include "chrome/browser/ui/browser_iterator.h" 43 #include "chrome/browser/ui/browser_iterator.h"
43 #include "chrome/browser/ui/browser_navigator.h" 44 #include "chrome/browser/ui/browser_navigator.h"
(...skipping 1354 matching lines...) Expand 10 before | Expand all | Expand 10 after
1398 1399
1399 EXPECT_FALSE( 1400 EXPECT_FALSE(
1400 dev_tools_browser->SupportsWindowFeature(Browser::FEATURE_LOCATIONBAR)); 1401 dev_tools_browser->SupportsWindowFeature(Browser::FEATURE_LOCATIONBAR));
1401 EXPECT_FALSE( 1402 EXPECT_FALSE(
1402 app_browser->SupportsWindowFeature(Browser::FEATURE_LOCATIONBAR)); 1403 app_browser->SupportsWindowFeature(Browser::FEATURE_LOCATIONBAR));
1403 } 1404 }
1404 #endif 1405 #endif
1405 1406
1406 // Tests that the CLD (Compact Language Detection) works properly. 1407 // Tests that the CLD (Compact Language Detection) works properly.
1407 IN_PROC_BROWSER_TEST_F(BrowserTest, PageLanguageDetection) { 1408 IN_PROC_BROWSER_TEST_F(BrowserTest, PageLanguageDetection) {
1408 test::ScopedCLDDynamicDataHarness dynamic_data_scope; 1409 scoped_ptr<test::CldDataHarness> cld_data_harness =
1409 ASSERT_NO_FATAL_FAILURE(dynamic_data_scope.Init()); 1410 test::CreateCldDataHarness();
1411 ASSERT_NO_FATAL_FAILURE(cld_data_harness->Init());
1410 ASSERT_TRUE(test_server()->Start()); 1412 ASSERT_TRUE(test_server()->Start());
1411 1413
1412 LanguageDetectionDetails details; 1414 LanguageDetectionDetails details;
1413 1415
1414 // Open a new tab with a page in English. 1416 // Open a new tab with a page in English.
1415 AddTabAtIndex(0, GURL(test_server()->GetURL("files/english_page.html")), 1417 AddTabAtIndex(0, GURL(test_server()->GetURL("files/english_page.html")),
1416 content::PAGE_TRANSITION_TYPED); 1418 content::PAGE_TRANSITION_TYPED);
1417 1419
1418 WebContents* current_web_contents = 1420 WebContents* current_web_contents =
1419 browser()->tab_strip_model()->GetActiveWebContents(); 1421 browser()->tab_strip_model()->GetActiveWebContents();
(...skipping 1268 matching lines...) Expand 10 before | Expand all | Expand 10 after
2688 #endif 2690 #endif
2689 EXPECT_EQ(exp_commit_size, rwhv_commit_size2); 2691 EXPECT_EQ(exp_commit_size, rwhv_commit_size2);
2690 EXPECT_EQ(exp_commit_size, wcv_commit_size2); 2692 EXPECT_EQ(exp_commit_size, wcv_commit_size2);
2691 gfx::Size exp_final_size(initial_wcv_size); 2693 gfx::Size exp_final_size(initial_wcv_size);
2692 exp_final_size.Enlarge(wcv_resize_insets.width(), 2694 exp_final_size.Enlarge(wcv_resize_insets.width(),
2693 wcv_resize_insets.height() + height_inset); 2695 wcv_resize_insets.height() + height_inset);
2694 EXPECT_EQ(exp_final_size, 2696 EXPECT_EQ(exp_final_size,
2695 web_contents->GetRenderWidgetHostView()->GetViewBounds().size()); 2697 web_contents->GetRenderWidgetHostView()->GetViewBounds().size());
2696 EXPECT_EQ(exp_final_size, web_contents->GetContainerBounds().size()); 2698 EXPECT_EQ(exp_final_size, web_contents->GetContainerBounds().size());
2697 } 2699 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698