From 3edafc460766abdf973fedbcb34b71444c11f451 Mon Sep 17 00:00:00 2001 From: brettw Date: Tue, 17 Feb 2015 13:29:03 -0800 Subject: [PATCH] Fix GN unit tests on Windows, GN x64 build. BUG=458939 Review URL: https://codereview.chromium.org/929383002 Cr-Commit-Position: refs/heads/master@{#316655} --- sandbox/win/BUILD.gn | 4 +++- tools/gn/source_dir_unittest.cc | 26 +++++++------------------- 2 files changed, 10 insertions(+), 20 deletions(-) diff --git a/sandbox/win/BUILD.gn b/sandbox/win/BUILD.gn index 0d9d1fb59947..d4d649626d1a 100644 --- a/sandbox/win/BUILD.gn +++ b/sandbox/win/BUILD.gn @@ -162,9 +162,11 @@ source_set("sandbox") { } deps = [ - ":copy_wow_helper", "//base", ] + if (cpu_arch == "x86") { + deps += [ ":copy_wow_helper" ] + } } if (cpu_arch == "x86") { diff --git a/tools/gn/source_dir_unittest.cc b/tools/gn/source_dir_unittest.cc index e306667dc833..5034335795be 100644 --- a/tools/gn/source_dir_unittest.cc +++ b/tools/gn/source_dir_unittest.cc @@ -6,13 +6,7 @@ #include "tools/gn/source_dir.h" #include "tools/gn/source_file.h" -// Fails on windows. http://crbug.com/458939 -#if defined(OS_WIN) -#define MAYBE_ResolveRelativeFile DISABLED_ResolveRelativeFile -#else -#define MAYBE_ResolveRelativeFile ResolveRelativeFile -#endif -TEST(SourceDir, MAYBE_ResolveRelativeFile) { +TEST(SourceDir, ResolveRelativeFile) { SourceDir base("//base/"); #if defined(OS_WIN) base::StringPiece source_root("C:/source/root"); @@ -47,7 +41,7 @@ TEST(SourceDir, MAYBE_ResolveRelativeFile) { // expect an absolute path. #if defined(OS_WIN) EXPECT_TRUE(base.ResolveRelativeFile("../../foo", source_root) == - SourceFile("C:/source/foo")); + SourceFile("/C:/source/foo")); #else EXPECT_TRUE(base.ResolveRelativeFile("../../foo", source_root) == SourceFile("/source/foo")); @@ -62,13 +56,7 @@ TEST(SourceDir, MAYBE_ResolveRelativeFile) { #endif } -// Fails on windows. http://crbug.com/458939 -#if defined(OS_WIN) -#define MAYBE_ResolveRelativeDir DISABLED_ResolveRelativeDir -#else -#define MAYBE_ResolveRelativeDir ResolveRelativeDir -#endif -TEST(SourceDir, MAYBE_ResolveRelativeDir) { +TEST(SourceDir, ResolveRelativeDir) { SourceDir base("//base/"); #if defined(OS_WIN) base::StringPiece source_root("C:/source/root"); @@ -97,16 +85,16 @@ TEST(SourceDir, MAYBE_ResolveRelativeDir) { // expect an absolute path. #if defined(OS_WIN) EXPECT_TRUE(base.ResolveRelativeDir("../../foo", source_root) == - SourceDir("C:/source/foo/")); + SourceDir("/C:/source/foo/")); #else EXPECT_TRUE(base.ResolveRelativeDir("../../foo", source_root) == SourceDir("/source/foo/")); #endif #if defined(OS_WIN) - // Note that we don't canonicalize the existing backslashes to forward - // slashes. This could potentially be changed in the future which would mean - // we should just change the expected result. + // Canonicalize the existing backslashes to forward slashes and add a + // leading slash if necessary. + EXPECT_TRUE(base.ResolveRelativeDir("\\C:\\foo") == SourceDir("/C:/foo/")); EXPECT_TRUE(base.ResolveRelativeDir("C:\\foo") == SourceDir("/C:/foo/")); #endif } -- 2.11.4.GIT