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

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

Issue 289373002: Fix browser test to work with dynamic CLD (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cld_browsertest
Patch Set: Add call to Init() to workaround gtest macro issues Created 6 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 11 matching lines...) Expand all
22 #include "chrome/browser/extensions/extension_service.h" 22 #include "chrome/browser/extensions/extension_service.h"
23 #include "chrome/browser/extensions/tab_helper.h" 23 #include "chrome/browser/extensions/tab_helper.h"
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/translate_browser_test_utils.h"
32 #include "chrome/browser/translate/translate_tab_helper.h" 33 #include "chrome/browser/translate/translate_tab_helper.h"
33 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog.h" 34 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog.h"
34 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog_queue.h" 35 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog_queue.h"
35 #include "chrome/browser/ui/app_modal_dialogs/javascript_app_modal_dialog.h" 36 #include "chrome/browser/ui/app_modal_dialogs/javascript_app_modal_dialog.h"
36 #include "chrome/browser/ui/app_modal_dialogs/native_app_modal_dialog.h" 37 #include "chrome/browser/ui/app_modal_dialogs/native_app_modal_dialog.h"
37 #include "chrome/browser/ui/browser.h" 38 #include "chrome/browser/ui/browser.h"
38 #include "chrome/browser/ui/browser_command_controller.h" 39 #include "chrome/browser/ui/browser_command_controller.h"
39 #include "chrome/browser/ui/browser_commands.h" 40 #include "chrome/browser/ui/browser_commands.h"
40 #include "chrome/browser/ui/browser_finder.h" 41 #include "chrome/browser/ui/browser_finder.h"
41 #include "chrome/browser/ui/browser_iterator.h" 42 #include "chrome/browser/ui/browser_iterator.h"
(...skipping 1354 matching lines...) Expand 10 before | Expand all | Expand 10 after
1396 1397
1397 EXPECT_FALSE( 1398 EXPECT_FALSE(
1398 dev_tools_browser->SupportsWindowFeature(Browser::FEATURE_LOCATIONBAR)); 1399 dev_tools_browser->SupportsWindowFeature(Browser::FEATURE_LOCATIONBAR));
1399 EXPECT_FALSE( 1400 EXPECT_FALSE(
1400 app_browser->SupportsWindowFeature(Browser::FEATURE_LOCATIONBAR)); 1401 app_browser->SupportsWindowFeature(Browser::FEATURE_LOCATIONBAR));
1401 } 1402 }
1402 #endif 1403 #endif
1403 1404
1404 // Tests that the CLD (Compact Language Detection) works properly. 1405 // Tests that the CLD (Compact Language Detection) works properly.
1405 IN_PROC_BROWSER_TEST_F(BrowserTest, PageLanguageDetection) { 1406 IN_PROC_BROWSER_TEST_F(BrowserTest, PageLanguageDetection) {
1407 test::ScopedCLDDynamicDataHarness dynamic_data_scope;
1408 ASSERT_NO_FATAL_FAILURE(dynamic_data_scope.Init());
1406 ASSERT_TRUE(test_server()->Start()); 1409 ASSERT_TRUE(test_server()->Start());
1407 1410
1408 //std::string lang; 1411 //std::string lang;
1409 LanguageDetectionDetails details; 1412 LanguageDetectionDetails details;
1410 1413
1411 // Open a new tab with a page in English. 1414 // Open a new tab with a page in English.
1412 AddTabAtIndex(0, GURL(test_server()->GetURL("files/english_page.html")), 1415 AddTabAtIndex(0, GURL(test_server()->GetURL("files/english_page.html")),
1413 content::PAGE_TRANSITION_TYPED); 1416 content::PAGE_TRANSITION_TYPED);
1414 1417
1415 WebContents* current_web_contents = 1418 WebContents* current_web_contents =
(...skipping 1267 matching lines...) Expand 10 before | Expand all | Expand 10 after
2683 #endif 2686 #endif
2684 EXPECT_EQ(exp_commit_size, rwhv_commit_size2); 2687 EXPECT_EQ(exp_commit_size, rwhv_commit_size2);
2685 EXPECT_EQ(exp_commit_size, wcv_commit_size2); 2688 EXPECT_EQ(exp_commit_size, wcv_commit_size2);
2686 gfx::Size exp_final_size(initial_wcv_size); 2689 gfx::Size exp_final_size(initial_wcv_size);
2687 exp_final_size.Enlarge(wcv_resize_insets.width(), 2690 exp_final_size.Enlarge(wcv_resize_insets.width(),
2688 wcv_resize_insets.height() + height_inset); 2691 wcv_resize_insets.height() + height_inset);
2689 EXPECT_EQ(exp_final_size, 2692 EXPECT_EQ(exp_final_size,
2690 web_contents->GetRenderWidgetHostView()->GetViewBounds().size()); 2693 web_contents->GetRenderWidgetHostView()->GetViewBounds().size());
2691 EXPECT_EQ(exp_final_size, web_contents->GetContainerBounds().size()); 2694 EXPECT_EQ(exp_final_size, web_contents->GetContainerBounds().size());
2692 } 2695 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698