| OLD | NEW |
| 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/file_path.h" | 6 #include "base/file_path.h" |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
| 9 #include "chrome/browser/extensions/extension_browsertest.h" | 9 #include "chrome/browser/extensions/extension_browsertest.h" |
| 10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 // TODO(bauerb): set the first run flag instead of creating a sentinel file. | 44 // TODO(bauerb): set the first run flag instead of creating a sentinel file. |
| 45 first_run::CreateSentinel(); | 45 first_run::CreateSentinel(); |
| 46 return ExtensionBrowserTest::SetUpUserDataDirectory(); | 46 return ExtensionBrowserTest::SetUpUserDataDirectory(); |
| 47 } | 47 } |
| 48 | 48 |
| 49 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 49 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| 50 ExtensionBrowserTest::SetUpCommandLine(command_line); | 50 ExtensionBrowserTest::SetUpCommandLine(command_line); |
| 51 command_line->AppendSwitch(switches::kEnablePanels); | 51 command_line->AppendSwitch(switches::kEnablePanels); |
| 52 command_line->AppendSwitchASCII(switches::kHomePage, | 52 command_line->AppendSwitchASCII(switches::kHomePage, |
| 53 chrome::kAboutBlankURL); | 53 chrome::kAboutBlankURL); |
| 54 #if defined(OS_CHROMEOS) |
| 55 // TODO(nkostylev): Investigate if we can remove this switch. |
| 56 command_line->AppendSwitch(switches::kCreateBrowserOnStartupForTests); |
| 57 #endif |
| 54 } | 58 } |
| 55 | 59 |
| 56 // Helper functions return void so that we can ASSERT*(). | 60 // Helper functions return void so that we can ASSERT*(). |
| 57 // Use ASSERT_NO_FATAL_FAILURE around calls to these functions to stop the | 61 // Use ASSERT_NO_FATAL_FAILURE around calls to these functions to stop the |
| 58 // test if an assert fails. | 62 // test if an assert fails. |
| 59 void LoadApp(const std::string& app_name, | 63 void LoadApp(const std::string& app_name, |
| 60 const Extension** out_app_extension) { | 64 const Extension** out_app_extension) { |
| 61 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII(app_name.c_str()))); | 65 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII(app_name.c_str()))); |
| 62 | 66 |
| 63 ExtensionService* service = browser()->profile()->GetExtensionService(); | 67 ExtensionService* service = browser()->profile()->GetExtensionService(); |
| (...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 663 ASSERT_EQ(1u, browser::GetBrowserCount(profile_urls)); | 667 ASSERT_EQ(1u, browser::GetBrowserCount(profile_urls)); |
| 664 new_browser = FindOneOtherBrowserForProfile(profile_urls, NULL); | 668 new_browser = FindOneOtherBrowserForProfile(profile_urls, NULL); |
| 665 ASSERT_TRUE(new_browser); | 669 ASSERT_TRUE(new_browser); |
| 666 ASSERT_EQ(1, new_browser->tab_count()); | 670 ASSERT_EQ(1, new_browser->tab_count()); |
| 667 EXPECT_EQ(GURL(chrome::kChromeUINewTabURL), | 671 EXPECT_EQ(GURL(chrome::kChromeUINewTabURL), |
| 668 chrome::GetWebContentsAt(new_browser, 0)->GetURL()); | 672 chrome::GetWebContentsAt(new_browser, 0)->GetURL()); |
| 669 EXPECT_EQ(1U, chrome::GetTabContentsAt(new_browser, 0)->infobar_tab_helper()-> | 673 EXPECT_EQ(1U, chrome::GetTabContentsAt(new_browser, 0)->infobar_tab_helper()-> |
| 670 GetInfoBarCount()); | 674 GetInfoBarCount()); |
| 671 } | 675 } |
| 672 #endif // !OS_CHROMEOS | 676 #endif // !OS_CHROMEOS |
| OLD | NEW |