diff options
author | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-07 20:31:24 +0000 |
---|---|---|
committer | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-07 20:31:24 +0000 |
commit | 8b717ea16c81a3ed0a5e1801987342a2e7155f8c (patch) | |
tree | 04d25d33bf4c45bef52d91268bd99727da5adcdc | |
parent | ef3c3d3b1818ec9c05ec8de5c448d3936da07987 (diff) | |
download | chromium_src-8b717ea16c81a3ed0a5e1801987342a2e7155f8c.zip chromium_src-8b717ea16c81a3ed0a5e1801987342a2e7155f8c.tar.gz chromium_src-8b717ea16c81a3ed0a5e1801987342a2e7155f8c.tar.bz2 |
Use chrome::kAboutCrashURL in a few most places.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/1612008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43871 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/metrics/metrics_service_uitest.cc | 15 | ||||
-rw-r--r-- | chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc | 5 | ||||
-rw-r--r-- | chrome/renderer/about_handler.cc | 15 | ||||
-rw-r--r-- | chrome/test/reliability/page_load_test.cc | 6 |
4 files changed, 22 insertions, 19 deletions
diff --git a/chrome/browser/metrics/metrics_service_uitest.cc b/chrome/browser/metrics/metrics_service_uitest.cc index 5dfe9d1..636cf1e 100644 --- a/chrome/browser/metrics/metrics_service_uitest.cc +++ b/chrome/browser/metrics/metrics_service_uitest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 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. @@ -11,12 +11,11 @@ #include "base/file_util.h" #include "base/path_service.h" #include "base/platform_thread.h" -#include "base/process_util.h" -#include "chrome/app/chrome_dll_resource.h" #include "chrome/browser/pref_service.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/pref_names.h" +#include "chrome/common/url_constants.h" #include "chrome/test/automation/tab_proxy.h" #include "chrome/test/automation/browser_proxy.h" #include "chrome/test/ui/ui_test.h" @@ -24,10 +23,10 @@ class MetricsServiceTest : public UITest { public: - MetricsServiceTest() : UITest() { - // We need to show the window so web content type tabs load. - show_window_ = true; - } + MetricsServiceTest() : UITest() { + // We need to show the window so web content type tabs load. + show_window_ = true; + } // Open a few tabs of random content void OpenTabs() { @@ -98,7 +97,7 @@ TEST_F(MetricsServiceTest, CrashRenderers) { #if defined(OS_WIN) || defined(USE_LINUX_BREAKPAD) expected_crashes_ = 1; #endif - ASSERT_TRUE(tab->NavigateToURLAsync(GURL("about:crash"))); + ASSERT_TRUE(tab->NavigateToURLAsync(GURL(chrome::kAboutCrashURL))); } // Give the browser a chance to notice the crashed tab. diff --git a/chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc b/chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc index 5e1d75a..eedf252 100644 --- a/chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc +++ b/chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 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. @@ -12,6 +12,7 @@ #include "chrome/browser/net/url_request_failed_dns_job.h" #include "chrome/browser/net/url_request_mock_http_job.h" #include "chrome/common/chrome_switches.h" +#include "chrome/common/url_constants.h" #include "chrome/test/automation/browser_proxy.h" #include "chrome/test/automation/tab_proxy.h" #include "chrome/test/ui/ui_test.h" @@ -220,7 +221,7 @@ TEST_F(ResourceDispatcherTest, CrossSiteAfterCrash) { #if defined(OS_WIN) expected_crashes_ = 1; #endif - ASSERT_TRUE(tab->NavigateToURLAsync(GURL("about:crash"))); + ASSERT_TRUE(tab->NavigateToURLAsync(GURL(chrome::kAboutCrashURL))); // Wait for browser to notice the renderer crash. PlatformThread::Sleep(sleep_timeout_ms()); diff --git a/chrome/renderer/about_handler.cc b/chrome/renderer/about_handler.cc index d775531..8412949 100644 --- a/chrome/renderer/about_handler.cc +++ b/chrome/renderer/about_handler.cc @@ -1,10 +1,11 @@ -// Copyright (c) 2006-2008 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 "chrome/renderer/about_handler.h" #include "base/platform_thread.h" +#include "chrome/common/url_constants.h" #include "googleurl/src/gurl.h" struct AboutHandlerUrl { @@ -13,14 +14,16 @@ struct AboutHandlerUrl { }; static AboutHandlerUrl about_urls[] = { - { "about:crash", AboutHandler::AboutCrash }, - { "about:hang", AboutHandler::AboutHang }, - { "about:shorthang", AboutHandler::AboutShortHang }, + { chrome::kAboutCrashURL, AboutHandler::AboutCrash }, + { chrome::kAboutHangURL, AboutHandler::AboutHang }, + { chrome::kAboutShorthangURL, AboutHandler::AboutShortHang }, { NULL, NULL } }; +static const char* kAboutScheme = "about"; + bool AboutHandler::WillHandle(const GURL& url) { - if (url.scheme() != "about") + if (url.scheme() != kAboutScheme) return false; struct AboutHandlerUrl* url_handler = about_urls; @@ -34,7 +37,7 @@ bool AboutHandler::WillHandle(const GURL& url) { // static bool AboutHandler::MaybeHandle(const GURL& url) { - if (url.scheme() != "about") + if (url.scheme() != kAboutScheme) return false; struct AboutHandlerUrl* url_handler = about_urls; diff --git a/chrome/test/reliability/page_load_test.cc b/chrome/test/reliability/page_load_test.cc index 041ab1f..8d63696 100644 --- a/chrome/test/reliability/page_load_test.cc +++ b/chrome/test/reliability/page_load_test.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-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. // @@ -54,6 +54,7 @@ #include "chrome/common/chrome_switches.h" #include "chrome/common/logging_chrome.h" #include "chrome/common/pref_names.h" +#include "chrome/common/url_constants.h" #include "chrome/test/automation/automation_messages.h" #include "chrome/test/automation/automation_proxy.h" #include "chrome/test/automation/browser_proxy.h" @@ -86,7 +87,6 @@ const char kDefaultServerUrl[] = "http://urllist.com"; std::string g_server_url; const char kTestPage1[] = "page1.html"; const char kTestPage2[] = "page2.html"; -const char crash_url[] = "about:crash"; // These are copied from v8 definitions as we cannot include them. const char kV8LogFileSwitch[] = "logfile"; @@ -356,7 +356,7 @@ class PageLoadTest : public UITest { EXPECT_EQ(0, metrics.plugin_crash_count); // Go to "about:crash" - NavigateToURLLogResult(crash_url, log_file, &metrics); + NavigateToURLLogResult(chrome::kAboutCrashURL, log_file, &metrics); // Found a crash dump EXPECT_EQ(1, metrics.crash_dump_count) << kFailedNoCrashService; // Browser did not crash, and exited cleanly. |