diff options
Diffstat (limited to 'chrome/browser/browser_init_browsertest.cc')
-rw-r--r-- | chrome/browser/browser_init_browsertest.cc | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/chrome/browser/browser_init_browsertest.cc b/chrome/browser/browser_init_browsertest.cc index 8d130fc..f5ad83c 100644 --- a/chrome/browser/browser_init_browsertest.cc +++ b/chrome/browser/browser_init_browsertest.cc @@ -1,7 +1,10 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/command_line.h" +#include "base/file_path.h" +#include "base/utf_string_conversions.h" #include "chrome/browser/browser.h" #include "chrome/browser/browser_init.h" #include "chrome/browser/browser_list.h" @@ -31,8 +34,7 @@ class OpenURLsPopupObserver : public BrowserList::Observer { // Test that when there is a popup as the active browser any requests to // BrowserInit::LaunchWithProfile::OpenURLsInBrowser don't crash because // there's no explicit profile given. -// Flaky, http://crbug.com/42318. -IN_PROC_BROWSER_TEST_F(BrowserInitTest, FLAKY_OpenURLsPopup) { +IN_PROC_BROWSER_TEST_F(BrowserInitTest, OpenURLsPopup) { std::vector<GURL> urls; urls.push_back(GURL("http://localhost")); @@ -49,7 +51,7 @@ IN_PROC_BROWSER_TEST_F(BrowserInitTest, FLAKY_OpenURLsPopup) { ASSERT_EQ(popup, observer.added_browser_); CommandLine dummy(CommandLine::ARGUMENTS_ONLY); - BrowserInit::LaunchWithProfile launch(std::wstring(), dummy); + BrowserInit::LaunchWithProfile launch(FilePath(), dummy); // This should create a new window, but re-use the profile from |popup|. If // it used a NULL or invalid profile, it would crash. launch.OpenURLsInBrowser(popup, false, urls); @@ -63,16 +65,16 @@ IN_PROC_BROWSER_TEST_F(BrowserInitTest, FLAKY_OpenURLsPopup) { // to start on most BuildBot runs and I don't want to add longer delays to // the test. I'll circle back and make this work properly when i get a chance. IN_PROC_BROWSER_TEST_F(BrowserInitTest, FLAKY_BlockBadURLs) { - const std::wstring testurlstr(L"http://localhost/"); - const GURL testurl(WideToUTF16Hack(testurlstr)); + const char* testurlstr = "http://localhost/"; + const GURL testurl(testurlstr); CommandLine cmdline(CommandLine::ARGUMENTS_ONLY); - cmdline.AppendLooseValue(testurlstr); - cmdline.AppendLooseValue(std::wstring(L"javascript:alert('boo')")); - cmdline.AppendLooseValue(testurlstr); - cmdline.AppendLooseValue(std::wstring(L"view-source:http://localhost/")); + cmdline.AppendArg(testurlstr); + cmdline.AppendArg("javascript:alert('boo')"); + cmdline.AppendArg(testurlstr); + cmdline.AppendArg("view-source:http://localhost/"); // This will pick up the current browser instance. - BrowserInit::LaunchWithProfile launch(std::wstring(), cmdline); + BrowserInit::LaunchWithProfile launch(FilePath(), cmdline); launch.Launch(browser()->profile(), false); // Give the browser a chance to start first. FIXME(jschuh) |