Commit 8f10d9b3 authored by tfarina@chromium.org's avatar tfarina@chromium.org

Use FilePath::Extension instead of the deprecated file_util::GetFileExtensionFromPath.

BUG=24672
TEST=trybots

Review URL: http://codereview.chromium.org/6326014

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72732 0039d316-1c4b-4281-b951-d872f2087c98
parent f3f79b10
// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "base/command_line.h" #include "base/command_line.h"
#include "base/file_path.h"
#include "base/file_util.h" #include "base/file_util.h"
#include "base/string_util.h"
#include "base/test/test_file_util.h" #include "base/test/test_file_util.h"
#include "base/threading/simple_thread.h" #include "base/threading/simple_thread.h"
#include "base/utf_string_conversions.h"
#include "chrome/test/automation/tab_proxy.h" #include "chrome/test/automation/tab_proxy.h"
#include "chrome/test/ui/ui_test.h" #include "chrome/test/ui/ui_test.h"
#include "net/test/test_server.h" #include "net/test/test_server.h"
...@@ -142,8 +145,8 @@ class PrintingLayoutTest : public PrintingTest<UITest> { ...@@ -142,8 +145,8 @@ class PrintingLayoutTest : public PrintingTest<UITest> {
found_prn = false; found_prn = false;
std::wstring file; std::wstring file;
while (!(file = enumerator.Next().ToWStringHack()).empty()) { while (!(file = enumerator.Next().ToWStringHack()).empty()) {
std::wstring ext = file_util::GetFileExtensionFromPath(file); std::wstring ext = FilePath(file).Extension();
if (!_wcsicmp(ext.c_str(), L"emf")) { if (base::strcasecmp(WideToUTF8(ext).c_str(), ".emf") == 0) {
EXPECT_FALSE(found_emf) << "Found a leftover .EMF file: \"" << EXPECT_FALSE(found_emf) << "Found a leftover .EMF file: \"" <<
emf_file << "\" and \"" << file << "\" when looking for \"" << emf_file << "\" and \"" << file << "\" when looking for \"" <<
verification_name << "\""; verification_name << "\"";
...@@ -151,7 +154,7 @@ class PrintingLayoutTest : public PrintingTest<UITest> { ...@@ -151,7 +154,7 @@ class PrintingLayoutTest : public PrintingTest<UITest> {
emf_file = file; emf_file = file;
continue; continue;
} }
if (!_wcsicmp(ext.c_str(), L"prn")) { if (base::strcasecmp(WideToUTF8(ext).c_str(), ".prn") == 0) {
EXPECT_FALSE(found_prn) << "Found a leftover .PRN file: \"" << EXPECT_FALSE(found_prn) << "Found a leftover .PRN file: \"" <<
prn_file << "\" and \"" << file << "\" when looking for \"" << prn_file << "\" and \"" << file << "\" when looking for \"" <<
verification_name << "\""; verification_name << "\"";
......
// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "chrome/test/mini_installer_test/mini_installer_test_util.h" #include "chrome/test/mini_installer_test/mini_installer_test_util.h"
#include "base/file_path.h"
#include "base/file_util.h" #include "base/file_util.h"
#include "base/path_service.h" #include "base/path_service.h"
#include "base/process_util.h" #include "base/process_util.h"
...@@ -145,8 +146,8 @@ bool MiniInstallerTestUtil::GetLatestFile(const wchar_t* file_name, ...@@ -145,8 +146,8 @@ bool MiniInstallerTestUtil::GetLatestFile(const wchar_t* file_name,
std::wstring search_path = find_file_data.cFileName; std::wstring search_path = find_file_data.cFileName;
size_t position_found = search_path.find(pattern); size_t position_found = search_path.find(pattern);
if (position_found != -1) { if (position_found != -1) {
std::wstring extension = file_util::GetFileExtensionFromPath(file_name); std::wstring extension = FilePath(file_name).Extension();
if ((base::strcasecmp(WideToUTF8(extension).c_str(), "exe")) == 0) { if ((base::strcasecmp(WideToUTF8(extension).c_str(), ".exe")) == 0) {
file_details->push_back(FileInfo(find_file_data.cFileName, 0)); file_details->push_back(FileInfo(find_file_data.cFileName, 0));
return_val = true; return_val = true;
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment