| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 1281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1292 base::Bind(&base::DoNothing), | 1292 base::Bind(&base::DoNothing), |
| 1293 NULL); | 1293 NULL); |
| 1294 EXPECT_EQ(1, observer.closing_count()); | 1294 EXPECT_EQ(1, observer.closing_count()); |
| 1295 | 1295 |
| 1296 model->RemoveObserver(&observer); | 1296 model->RemoveObserver(&observer); |
| 1297 | 1297 |
| 1298 // There should only be one tab now. | 1298 // There should only be one tab now. |
| 1299 ASSERT_EQ(1, browser()->tab_strip_model()->count()); | 1299 ASSERT_EQ(1, browser()->tab_strip_model()->count()); |
| 1300 } | 1300 } |
| 1301 | 1301 |
| 1302 #if !defined(OS_MACOSX) | |
| 1303 // Open with --app-id=<id>, and see that an application tab opens by default. | 1302 // Open with --app-id=<id>, and see that an application tab opens by default. |
| 1304 IN_PROC_BROWSER_TEST_F(BrowserTest, AppIdSwitch) { | 1303 IN_PROC_BROWSER_TEST_F(BrowserTest, AppIdSwitch) { |
| 1305 ASSERT_TRUE(test_server()->Start()); | 1304 ASSERT_TRUE(test_server()->Start()); |
| 1306 | 1305 |
| 1307 // There should be one tab to start with. | 1306 // There should be one tab to start with. |
| 1308 ASSERT_EQ(1, browser()->tab_strip_model()->count()); | 1307 ASSERT_EQ(1, browser()->tab_strip_model()->count()); |
| 1309 | 1308 |
| 1310 // Load an app. | 1309 // Load an app. |
| 1311 host_resolver()->AddRule("www.example.com", "127.0.0.1"); | 1310 host_resolver()->AddRule("www.example.com", "127.0.0.1"); |
| 1312 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("app/"))); | 1311 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("app/"))); |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1379 ASSERT_TRUE(app_browser); | 1378 ASSERT_TRUE(app_browser); |
| 1380 ASSERT_TRUE(app_browser != browser()); | 1379 ASSERT_TRUE(app_browser != browser()); |
| 1381 | 1380 |
| 1382 EXPECT_FALSE( | 1381 EXPECT_FALSE( |
| 1383 dev_tools_browser->SupportsWindowFeature(Browser::FEATURE_LOCATIONBAR)); | 1382 dev_tools_browser->SupportsWindowFeature(Browser::FEATURE_LOCATIONBAR)); |
| 1384 EXPECT_FALSE( | 1383 EXPECT_FALSE( |
| 1385 app_browser->SupportsWindowFeature(Browser::FEATURE_LOCATIONBAR)); | 1384 app_browser->SupportsWindowFeature(Browser::FEATURE_LOCATIONBAR)); |
| 1386 | 1385 |
| 1387 DevToolsWindowTesting::CloseDevToolsWindowSync(devtools_window); | 1386 DevToolsWindowTesting::CloseDevToolsWindowSync(devtools_window); |
| 1388 } | 1387 } |
| 1389 #endif // !defined(OS_MACOSX) | |
| 1390 | 1388 |
| 1391 // Tests that the CLD (Compact Language Detection) works properly. | 1389 // Tests that the CLD (Compact Language Detection) works properly. |
| 1392 IN_PROC_BROWSER_TEST_F(BrowserTest, PageLanguageDetection) { | 1390 IN_PROC_BROWSER_TEST_F(BrowserTest, PageLanguageDetection) { |
| 1393 scoped_ptr<test::CldDataHarness> cld_data_harness = | 1391 scoped_ptr<test::CldDataHarness> cld_data_harness = |
| 1394 test::CldDataHarnessFactory::Get()->CreateCldDataHarness(); | 1392 test::CldDataHarnessFactory::Get()->CreateCldDataHarness(); |
| 1395 ASSERT_NO_FATAL_FAILURE(cld_data_harness->Init()); | 1393 ASSERT_NO_FATAL_FAILURE(cld_data_harness->Init()); |
| 1396 ASSERT_TRUE(test_server()->Start()); | 1394 ASSERT_TRUE(test_server()->Start()); |
| 1397 | 1395 |
| 1398 translate::LanguageDetectionDetails details; | 1396 translate::LanguageDetectionDetails details; |
| 1399 | 1397 |
| (...skipping 1299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2699 #endif | 2697 #endif |
| 2700 EXPECT_EQ(exp_commit_size, rwhv_commit_size2); | 2698 EXPECT_EQ(exp_commit_size, rwhv_commit_size2); |
| 2701 EXPECT_EQ(exp_commit_size, wcv_commit_size2); | 2699 EXPECT_EQ(exp_commit_size, wcv_commit_size2); |
| 2702 gfx::Size exp_final_size(initial_wcv_size); | 2700 gfx::Size exp_final_size(initial_wcv_size); |
| 2703 exp_final_size.Enlarge(wcv_resize_insets.width(), | 2701 exp_final_size.Enlarge(wcv_resize_insets.width(), |
| 2704 wcv_resize_insets.height() + height_inset); | 2702 wcv_resize_insets.height() + height_inset); |
| 2705 EXPECT_EQ(exp_final_size, | 2703 EXPECT_EQ(exp_final_size, |
| 2706 web_contents->GetRenderWidgetHostView()->GetViewBounds().size()); | 2704 web_contents->GetRenderWidgetHostView()->GetViewBounds().size()); |
| 2707 EXPECT_EQ(exp_final_size, web_contents->GetContainerBounds().size()); | 2705 EXPECT_EQ(exp_final_size, web_contents->GetContainerBounds().size()); |
| 2708 } | 2706 } |
| OLD | NEW |