Commit 80b669a6 authored by Kent Tamura's avatar Kent Tamura Committed by Commit Bot

Fix failures in blink_platform_unittests and webkit_unit_tests.

* Fix blink::test::BlinkRootDir() so that it returns //third_party/blink
 Fix its callsites. Typically "Source/" -> "renderer/"

* Add blink::test::BlinkLayoutTestsDir(), which returns
  //third_party/WebKit/LayoutTests.
 Some tests refer to files in LayoutTests, which is not moved
 to //third_party/blink yet.

TBR=qyearsley@chromium.org
NOTREECHECKS=true
NOTRY=true

Bug: 768828
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I2a3b314fc11786a2a27422a22ca746c550bad0f3
Reviewed-on: https://chromium-review.googlesource.com/1000894
Commit-Queue: Kent Tamura <tkent@chromium.org>
Reviewed-by: default avatarKent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#549067}
parent ba75a9c3
......@@ -124,7 +124,8 @@ TEST(SerializedScriptValueTest, UserSelectedFile) {
V8TestingScope scope;
String file_path = test::BlinkRootDir();
file_path.append(
"/Source/bindings/core/v8/serialization/SerializedScriptValueTest.cpp");
"/renderer/bindings/core/v8/serialization/"
"serialized_script_value_test.cc");
File* original_file = File::Create(file_path);
ASSERT_TRUE(original_file->HasBackingFile());
ASSERT_EQ(File::kIsUserVisible, original_file->GetUserVisibility());
......
......@@ -314,7 +314,7 @@ class AnimationCompositorAnimationsTest : public RenderingTest {
void LoadTestData(const std::string& file_name) {
String testing_path = test::BlinkRootDir();
testing_path.append("/Source/core/animation/test_data/");
testing_path.append("/renderer/core/animation/test_data/");
WebURL url = URLTestHelpers::RegisterMockedURLLoadFromBase(
WebString::FromUTF8(base_url_), testing_path,
WebString::FromUTF8(file_name));
......
......@@ -65,7 +65,7 @@ TEST_F(DataObjectTest, DataObjectObserver) {
data_object_->AddObserver(observer2);
String file_path = test::BlinkRootDir();
file_path.append("/Source/core/clipboard/DataObjectTest.cpp");
file_path.append("/renderer/core/clipboard/dat_aobject_test.cc");
data_object_->AddFilename(file_path, String(), String());
EXPECT_EQ(2U, data_object_->length());
EXPECT_EQ(4U, observer->call_count());
......@@ -84,7 +84,7 @@ TEST_F(DataObjectTest, DataObjectObserver) {
TEST_F(DataObjectTest, addItemWithFilenameAndNoTitle) {
String file_path = test::BlinkRootDir();
file_path.append("/Source/core/clipboard/DataObjectTest.cpp");
file_path.append("/renderer/core/clipboard/data_object_test.cc");
data_object_->AddFilename(file_path, String(), String());
EXPECT_EQ(1U, data_object_->length());
......@@ -102,7 +102,7 @@ TEST_F(DataObjectTest, addItemWithFilenameAndNoTitle) {
TEST_F(DataObjectTest, addItemWithFilenameAndTitle) {
String file_path = test::BlinkRootDir();
file_path.append("/Source/core/clipboard/DataObjectTest.cpp");
file_path.append("/renderer/core/clipboard/data_object_test.cc");
data_object_->AddFilename(file_path, "name.cpp", String());
EXPECT_EQ(1U, data_object_->length());
......@@ -121,7 +121,7 @@ TEST_F(DataObjectTest, addItemWithFilenameAndTitle) {
TEST_F(DataObjectTest, fileSystemId) {
String file_path = test::BlinkRootDir();
file_path.append("/Source/core/clipboard/DataObjectTest.cpp");
file_path.append("/renderer/core/clipboard/data_object_test.cpp");
KURL url;
data_object_->AddFilename(file_path, String(), String());
......
......@@ -58,13 +58,13 @@ String MojoBindingsScriptPath() {
String TestBindingsScriptPath() {
String filepath = test::ExecutableDir();
filepath.append(
"/gen/third_party/WebKit/Source/core/mojo/tests/JsToCpp.mojom.js");
"/gen/third_party/blink/renderer/core/mojo/tests/JsToCpp.mojom.js");
return filepath;
}
String TestScriptPath() {
String filepath = test::BlinkRootDir();
filepath.append("/Source/core/mojo/tests/JsToCppTest.js");
filepath.append("/renderer/core/mojo/tests/JsToCppTest.js");
return filepath;
}
......
......@@ -15,7 +15,7 @@ namespace blink {
void PaintPropertyTreeBuilderTest::LoadTestData(const char* file_name) {
String full_path = test::BlinkRootDir();
full_path.append("/Source/core/paint/test_data/");
full_path.append("/renderer/core/paint/test_data/");
full_path.append(file_name);
const Vector<char> input_buffer = test::ReadFromFile(full_path)->Copy();
SetBodyInnerHTML(String(input_buffer.data(), input_buffer.size()));
......
......@@ -14,7 +14,8 @@ class DOMFileSystemBaseTest : public testing::Test {
public:
DOMFileSystemBaseTest() {
file_path_ = test::BlinkRootDir();
file_path_.append("/Source/modules/filesystem/DOMFileSystemBaseTest.cpp");
file_path_.append(
"/renderer/modules/filesystem/dom_file_system_base_test.cc");
GetFileMetadata(file_path_, file_metadata_);
file_metadata_.platform_path = file_path_;
}
......@@ -30,11 +31,11 @@ TEST_F(DOMFileSystemBaseTest, externalFilesystemFilesAreUserVisible) {
File* file = DOMFileSystemBase::CreateFile(file_metadata_, root_url,
kFileSystemTypeExternal,
"DOMFileSystemBaseTest.cpp");
"dom_file_system_base_test.cc");
EXPECT_TRUE(file);
EXPECT_TRUE(file->HasBackingFile());
EXPECT_EQ(File::kIsUserVisible, file->GetUserVisibility());
EXPECT_EQ("DOMFileSystemBaseTest.cpp", file->name());
EXPECT_EQ("dom_file_system_base_test.cc", file->name());
EXPECT_EQ(file_path_, file->GetPath());
}
......
......@@ -67,38 +67,37 @@ static void MixImages(const char* file_name,
}
TEST(DeferredImageDecoderTestWoPlatform, mixImagesGif) {
MixImages("/LayoutTests/images/resources/animated.gif", 818u, 1u);
MixImages("/images/resources/animated.gif", 818u, 1u);
}
TEST(DeferredImageDecoderTestWoPlatform, mixImagesPng) {
MixImages("/LayoutTests/images/resources/mu.png", 910u, 0u);
MixImages("/images/resources/mu.png", 910u, 0u);
}
TEST(DeferredImageDecoderTestWoPlatform, mixImagesJpg) {
MixImages("/LayoutTests/images/resources/2-dht.jpg", 177u, 0u);
MixImages("/images/resources/2-dht.jpg", 177u, 0u);
}
TEST(DeferredImageDecoderTestWoPlatform, mixImagesWebp) {
MixImages("/LayoutTests/images/resources/webp-animated.webp", 142u, 1u);
MixImages("/images/resources/webp-animated.webp", 142u, 1u);
}
TEST(DeferredImageDecoderTestWoPlatform, mixImagesBmp) {
MixImages("/LayoutTests/images/resources/lenna.bmp", 122u, 0u);
MixImages("/images/resources/lenna.bmp", 122u, 0u);
}
TEST(DeferredImageDecoderTestWoPlatform, mixImagesIco) {
MixImages("/LayoutTests/images/resources/wrong-frame-dimensions.ico", 1376u,
1u);
MixImages("/images/resources/wrong-frame-dimensions.ico", 1376u, 1u);
}
TEST(DeferredImageDecoderTestWoPlatform, fragmentedSignature) {
const char* test_files[] = {
"/LayoutTests/images/resources/animated.gif",
"/LayoutTests/images/resources/mu.png",
"/LayoutTests/images/resources/2-dht.jpg",
"/LayoutTests/images/resources/webp-animated.webp",
"/LayoutTests/images/resources/lenna.bmp",
"/LayoutTests/images/resources/wrong-frame-dimensions.ico",
"/images/resources/animated.gif",
"/images/resources/mu.png",
"/images/resources/2-dht.jpg",
"/images/resources/webp-animated.webp",
"/images/resources/lenna.bmp",
"/images/resources/wrong-frame-dimensions.ico",
};
for (size_t i = 0; i < SK_ARRAY_COUNT(test_files); ++i) {
......
......@@ -43,7 +43,7 @@ class HighContrastImageClassifierTest : public testing::Test {
protected:
scoped_refptr<BitmapImage> LoadImage(const std::string& file_name) {
String file_path = test::BlinkRootDir();
String file_path = test::BlinkLayoutTestsDir();
file_path.append(file_name.c_str());
scoped_refptr<SharedBuffer> image_data = test::ReadFromFile(file_path);
EXPECT_TRUE(image_data.get() && image_data.get()->size());
......@@ -66,8 +66,8 @@ TEST_F(HighContrastImageClassifierTest, FeaturesAndClassification) {
// Color Buckets Ratio: Low
// Decision Tree: Apply
// Neural Network: NA
EXPECT_TRUE(GetFeaturesAndClassification(
"/LayoutTests/images/resources/grid-large.png", &features));
EXPECT_TRUE(GetFeaturesAndClassification("/images/resources/grid-large.png",
&features));
EXPECT_EQ(classifier()->ClassifyImageUsingDecisionTreeForTesting(features),
HighContrastClassification::kApplyHighContrastFilter);
AssertFeaturesEqual(features, {0.0f, 0.1875f, 0.0f, 0.1f});
......@@ -77,8 +77,8 @@ TEST_F(HighContrastImageClassifierTest, FeaturesAndClassification) {
// Color Buckets Ratio: Medium
// Decision Tree: Can't Decide
// Neural Network: Apply
EXPECT_TRUE(GetFeaturesAndClassification(
"/LayoutTests/images/resources/apng08-ref.png", &features));
EXPECT_TRUE(GetFeaturesAndClassification("/images/resources/apng08-ref.png",
&features));
EXPECT_EQ(classifier()->ClassifyImageUsingDecisionTreeForTesting(features),
HighContrastClassification::kNotClassified);
AssertFeaturesEqual(features, {0.0f, 0.8125f, 0.409f, 0.59f});
......@@ -89,7 +89,7 @@ TEST_F(HighContrastImageClassifierTest, FeaturesAndClassification) {
// Decision Tree: Apply
// Neural Network: NA.
EXPECT_TRUE(GetFeaturesAndClassification(
"/LayoutTests/images/resources/count-down-color-test.png", &features));
"/images/resources/count-down-color-test.png", &features));
EXPECT_EQ(classifier()->ClassifyImageUsingDecisionTreeForTesting(features),
HighContrastClassification::kApplyHighContrastFilter);
AssertFeaturesEqual(features, {1.0f, 0.0134277f, 0.0f, 0.43f});
......@@ -100,8 +100,7 @@ TEST_F(HighContrastImageClassifierTest, FeaturesAndClassification) {
// Decision Tree: Do Not Apply
// Neural Network: NA.
EXPECT_FALSE(GetFeaturesAndClassification(
"/LayoutTests/images/resources/blue-wheel-srgb-color-profile.png",
&features));
"/images/resources/blue-wheel-srgb-color-profile.png", &features));
EXPECT_EQ(classifier()->ClassifyImageUsingDecisionTreeForTesting(features),
HighContrastClassification::kDoNotApplyHighContrastFilter);
AssertFeaturesEqual(features, {1.0f, 0.03027f, 0.0f, 0.24f});
......@@ -112,7 +111,7 @@ TEST_F(HighContrastImageClassifierTest, FeaturesAndClassification) {
// Decision Tree: Can't Decide
// Neural Network: Apply.
EXPECT_TRUE(GetFeaturesAndClassification(
"/LayoutTests/images/resources/ycbcr-444-float.jpg", &features));
"/images/resources/ycbcr-444-float.jpg", &features));
EXPECT_EQ(classifier()->ClassifyImageUsingDecisionTreeForTesting(features),
HighContrastClassification::kNotClassified);
AssertFeaturesEqual(features, {1.0f, 0.0166016f, 0.0f, 0.59f});
......
......@@ -22,8 +22,7 @@ std::unique_ptr<ImageDecoder> CreateBMPDecoder() {
} // anonymous namespace
TEST(BMPImageDecoderTest, isSizeAvailable) {
static constexpr char kBmpFile[] =
"/LayoutTests/images/resources/lenna.bmp"; // 256x256
static constexpr char kBmpFile[] = "/images/resources/lenna.bmp"; // 256x256
scoped_refptr<SharedBuffer> data = ReadFile(kBmpFile);
ASSERT_TRUE(data.get());
......@@ -35,8 +34,7 @@ TEST(BMPImageDecoderTest, isSizeAvailable) {
}
TEST(BMPImageDecoderTest, parseAndDecode) {
static constexpr char kBmpFile[] =
"/LayoutTests/images/resources/lenna.bmp"; // 256x256
static constexpr char kBmpFile[] = "/images/resources/lenna.bmp"; // 256x256
scoped_refptr<SharedBuffer> data = ReadFile(kBmpFile);
ASSERT_TRUE(data.get());
......@@ -53,8 +51,7 @@ TEST(BMPImageDecoderTest, parseAndDecode) {
// Test if a BMP decoder returns a proper error while decoding an empty image.
TEST(BMPImageDecoderTest, emptyImage) {
static constexpr char kBmpFile[] =
"/LayoutTests/images/resources/0x0.bmp"; // 0x0
static constexpr char kBmpFile[] = "/images/resources/0x0.bmp"; // 0x0
scoped_refptr<SharedBuffer> data = ReadFile(kBmpFile);
ASSERT_TRUE(data.get());
......@@ -69,7 +66,7 @@ TEST(BMPImageDecoderTest, emptyImage) {
TEST(BMPImageDecoderTest, int32MinHeight) {
static constexpr char kBmpFile[] =
"/LayoutTests/images/resources/1xint32_min.bmp"; // 0xINT32_MIN
"/images/resources/1xint32_min.bmp"; // 0xINT32_MIN
scoped_refptr<SharedBuffer> data = ReadFile(kBmpFile);
std::unique_ptr<ImageDecoder> decoder = CreateBMPDecoder();
// Test when not all data is received.
......@@ -83,14 +80,13 @@ TEST(BMPImageDecoderTest, int32MinHeight) {
// size (when BMPImageDecoder stops while it may still have input data to
// read) and a call to do a full decode.
TEST(BMPImageDecoderTest, mergeBuffer) {
static constexpr char kBmpFile[] = "/LayoutTests/images/resources/lenna.bmp";
static constexpr char kBmpFile[] = "/images/resources/lenna.bmp";
TestMergeBuffer(&CreateBMPDecoder, kBmpFile);
}
// Verify that decoding this image does not crash.
TEST(BMPImageDecoderTest, crbug752898) {
static constexpr char kBmpFile[] =
"/LayoutTests/images/resources/crbug752898.bmp";
static constexpr char kBmpFile[] = "/images/resources/crbug752898.bmp";
scoped_refptr<SharedBuffer> data = ReadFile(kBmpFile);
ASSERT_TRUE(data.get());
......
......@@ -21,7 +21,7 @@ std::unique_ptr<ImageDecoder> CreateICODecoder() {
TEST(ICOImageDecoderTests, trunctedIco) {
const Vector<char> data =
ReadFile("/LayoutTests/images/resources/png-in-ico.ico")->Copy();
ReadFile("/images/resources/png-in-ico.ico")->Copy();
ASSERT_FALSE(data.IsEmpty());
scoped_refptr<SharedBuffer> truncated_data =
......@@ -39,7 +39,7 @@ TEST(ICOImageDecoderTests, trunctedIco) {
TEST(ICOImageDecoderTests, errorInPngInIco) {
const Vector<char> data =
ReadFile("/LayoutTests/images/resources/png-in-ico.ico")->Copy();
ReadFile("/images/resources/png-in-ico.ico")->Copy();
ASSERT_FALSE(data.IsEmpty());
// Modify the file to have a broken CRC in IHDR.
......@@ -66,24 +66,19 @@ TEST(ICOImageDecoderTests, errorInPngInIco) {
}
TEST(ICOImageDecoderTests, parseAndDecodeByteByByte) {
TestByteByByteDecode(&CreateICODecoder,
"/LayoutTests/images/resources/png-in-ico.ico", 1u,
TestByteByByteDecode(&CreateICODecoder, "/images/resources/png-in-ico.ico",
1u, kAnimationNone);
TestByteByByteDecode(&CreateICODecoder, "/images/resources/2entries.ico", 2u,
kAnimationNone);
TestByteByByteDecode(&CreateICODecoder,
"/LayoutTests/images/resources/2entries.ico", 2u,
"/images/resources/greenbox-3frames.cur", 3u,
kAnimationNone);
TestByteByByteDecode(&CreateICODecoder,
"/LayoutTests/images/resources/greenbox-3frames.cur", 3u,
"/images/resources/icon-without-and-bitmap.ico", 1u,
kAnimationNone);
TestByteByByteDecode(
&CreateICODecoder,
"/LayoutTests/images/resources/icon-without-and-bitmap.ico", 1u,
kAnimationNone);
TestByteByByteDecode(&CreateICODecoder,
"/LayoutTests/images/resources/1bit.ico", 1u,
TestByteByByteDecode(&CreateICODecoder, "/images/resources/1bit.ico", 1u,
kAnimationNone);
TestByteByByteDecode(&CreateICODecoder,
"/LayoutTests/images/resources/bug653075.ico", 2u,
TestByteByByteDecode(&CreateICODecoder, "/images/resources/bug653075.ico", 2u,
kAnimationNone);
}
......@@ -91,7 +86,7 @@ TEST(ICOImageDecoderTests, NullData) {
static constexpr size_t kSizeOfBadBlock = 6 + 16 + 1;
scoped_refptr<SharedBuffer> ico_file_data =
ReadFile("/LayoutTests/images/resources/png-in-ico.ico");
ReadFile("/images/resources/png-in-ico.ico");
ASSERT_FALSE(ico_file_data->IsEmpty());
ASSERT_LT(kSizeOfBadBlock, ico_file_data->size());
......
......@@ -15,16 +15,22 @@
namespace blink {
scoped_refptr<SharedBuffer> ReadFile(const char* file_name) {
String file_path = test::BlinkRootDir();
String file_path = test::BlinkLayoutTestsDir();
file_path.append(file_name);
return test::ReadFromFile(file_path);
}
scoped_refptr<SharedBuffer> ReadFile(const char* dir, const char* file_name) {
StringBuilder file_path;
file_path.Append(test::BlinkRootDir());
file_path.Append('/');
file_path.Append(dir);
if (strncmp(dir, "LayoutTests/", 12) == 0) {
file_path.Append(test::BlinkLayoutTestsDir());
file_path.Append('/');
file_path.Append(dir + 12);
} else {
file_path.Append(test::BlinkRootDir());
file_path.Append('/');
file_path.Append(dir);
}
file_path.Append('/');
file_path.Append(file_name);
return test::ReadFromFile(file_path.ToString());
......
......@@ -15,7 +15,7 @@ class SkBitmap;
namespace blink {
class ImageDecoder;
const char kDecodersTestingDir[] = "Source/platform/image-decoders/testing";
const char kDecodersTestingDir[] = "renderer/platform/image-decoders/testing";
const unsigned kDefaultTestSize = 4 * SharedBuffer::kSegmentSize;
using DecoderCreator = std::unique_ptr<ImageDecoder> (*)();
......
......@@ -146,7 +146,7 @@ TEST(JPEGImageDecoderTest, tooBig) {
// multiples of 8, to ensure we compute the correct DecodedSize and pass correct
// parameters to libjpeg to output the image with the expected size.
TEST(JPEGImageDecoderTest, downsampleImageSizeMultipleOf8) {
const char* jpeg_file = "/LayoutTests/images/resources/lenna.jpg"; // 256x256
const char* jpeg_file = "/images/resources/lenna.jpg"; // 256x256
unsigned output_width, output_height;
// 1/8 downsample.
......@@ -188,8 +188,7 @@ TEST(JPEGImageDecoderTest, downsampleImageSizeMultipleOf8) {
// Tests that JPEG decoder can downsample image whose width and height are not
// multiple of 8. Ensures that we round using the same algorithm as libjpeg.
TEST(JPEGImageDecoderTest, downsampleImageSizeNotMultipleOf8) {
const char* jpeg_file =
"/LayoutTests/images/resources/icc-v2-gbr.jpg"; // 275x207
const char* jpeg_file = "/images/resources/icc-v2-gbr.jpg"; // 275x207
unsigned output_width, output_height;
// 1/8 downsample.
......@@ -230,7 +229,7 @@ TEST(JPEGImageDecoderTest, downsampleImageSizeNotMultipleOf8) {
// Tests that upsampling is not allowed.
TEST(JPEGImageDecoderTest, upsample) {
const char* jpeg_file = "/LayoutTests/images/resources/lenna.jpg"; // 256x256
const char* jpeg_file = "/images/resources/lenna.jpg"; // 256x256
unsigned output_width, output_height;
Downsample(kLargeEnoughSize, &output_width, &output_height, jpeg_file);
EXPECT_EQ(256u, output_width);
......@@ -238,8 +237,7 @@ TEST(JPEGImageDecoderTest, upsample) {
}
TEST(JPEGImageDecoderTest, yuv) {
const char* jpeg_file =
"/LayoutTests/images/resources/lenna.jpg"; // 256x256, YUV 4:2:0
const char* jpeg_file = "/images/resources/lenna.jpg"; // 256x256, YUV 4:2:0
unsigned output_y_width, output_y_height, output_uv_width, output_uv_height;
ReadYUV(kLargeEnoughSize, &output_y_width, &output_y_height, &output_uv_width,
&output_uv_height, jpeg_file);
......@@ -249,7 +247,7 @@ TEST(JPEGImageDecoderTest, yuv) {
EXPECT_EQ(128u, output_uv_height);
const char* jpeg_file_image_size_not_multiple_of8 =
"/LayoutTests/images/resources/cropped_mandrill.jpg"; // 439x154
"/images/resources/cropped_mandrill.jpg"; // 439x154
ReadYUV(kLargeEnoughSize, &output_y_width, &output_y_height, &output_uv_width,
&output_uv_height, jpeg_file_image_size_not_multiple_of8);
EXPECT_EQ(439u, output_y_width);
......@@ -274,22 +272,20 @@ TEST(JPEGImageDecoderTest, yuv) {
TEST(JPEGImageDecoderTest,
byteByByteBaselineJPEGWithColorProfileAndRestartMarkers) {
TestByteByByteDecode(&CreateJPEGDecoder,
"/LayoutTests/images/resources/"
"/images/resources/"
"small-square-with-colorspin-profile.jpg",
1u, kAnimationNone);
}
TEST(JPEGImageDecoderTest, byteByByteProgressiveJPEG) {
TestByteByByteDecode(&CreateJPEGDecoder,
"/LayoutTests/images/resources/bug106024.jpg", 1u,
kAnimationNone);
TestByteByByteDecode(&CreateJPEGDecoder, "/images/resources/bug106024.jpg",
1u, kAnimationNone);
}
TEST(JPEGImageDecoderTest, byteByByteRGBJPEGWithAdobeMarkers) {
TestByteByByteDecode(
&CreateJPEGDecoder,
"/LayoutTests/images/resources/rgb-jpeg-with-adobe-marker-only.jpg", 1u,
kAnimationNone);
TestByteByByteDecode(&CreateJPEGDecoder,
"/images/resources/rgb-jpeg-with-adobe-marker-only.jpg",
1u, kAnimationNone);
}
// This test verifies that calling SharedBuffer::MergeSegmentsIntoBuffer() does
......@@ -297,7 +293,7 @@ TEST(JPEGImageDecoderTest, byteByByteRGBJPEGWithAdobeMarkers) {
// size (when JPEGImageDecoder stops while it may still have input data to
// read) and a call to do a full decode.
TEST(JPEGImageDecoderTest, mergeBuffer) {
const char* jpeg_file = "/LayoutTests/images/resources/lenna.jpg";
const char* jpeg_file = "/images/resources/lenna.jpg";
TestMergeBuffer(&CreateJPEGDecoder, jpeg_file);
}
......@@ -316,7 +312,7 @@ TEST(JPEGImageDecoderTest, manyProgressiveScans) {
}
TEST(JPEGImageDecoderTest, SupportedSizesSquare) {
const char* jpeg_file = "/LayoutTests/images/resources/lenna.jpg"; // 256x256
const char* jpeg_file = "/images/resources/lenna.jpg"; // 256x256
scoped_refptr<SharedBuffer> data = ReadFile(jpeg_file);
ASSERT_TRUE(data);
......@@ -340,8 +336,7 @@ TEST(JPEGImageDecoderTest, SupportedSizesSquare) {
}
TEST(JPEGImageDecoderTest, SupportedSizesRectangle) {
const char* jpeg_file =
"/LayoutTests/images/resources/icc-v2-gbr.jpg"; // 275x207
const char* jpeg_file = "/images/resources/icc-v2-gbr.jpg"; // 275x207
scoped_refptr<SharedBuffer> data = ReadFile(jpeg_file);
ASSERT_TRUE(data);
......@@ -367,7 +362,7 @@ TEST(JPEGImageDecoderTest, SupportedSizesRectangle) {
}
TEST(JPEGImageDecoderTest, SupportedSizesTruncatedIfMemoryBound) {
const char* jpeg_file = "/LayoutTests/images/resources/lenna.jpg"; // 256x256
const char* jpeg_file = "/images/resources/lenna.jpg"; // 256x256
scoped_refptr<SharedBuffer> data = ReadFile(jpeg_file);
ASSERT_TRUE(data);
......
......@@ -47,7 +47,14 @@ base::FilePath BlinkRootFilePath() {
base::FilePath path;
base::PathService::Get(base::DIR_SOURCE_ROOT, &path);
return base::MakeAbsoluteFilePath(
path.Append(FILE_PATH_LITERAL("third_party/WebKit")));
path.Append(FILE_PATH_LITERAL("third_party/blink")));
}
base::FilePath LayoutTestsFilePath() {
base::FilePath path;
base::PathService::Get(base::DIR_SOURCE_ROOT, &path);
return base::MakeAbsoluteFilePath(
path.Append(FILE_PATH_LITERAL("third_party/WebKit/LayoutTests")));
}
} // namespace
......@@ -85,6 +92,10 @@ String BlinkRootDir() {
return FilePathToWebString(BlinkRootFilePath());
}
String BlinkLayoutTestsDir() {
return FilePathToWebString(LayoutTestsFilePath());
}
String ExecutableDir() {
base::FilePath path;
base::PathService::Get(base::DIR_EXE, &path);
......@@ -94,14 +105,14 @@ String ExecutableDir() {
String CoreTestDataPath(const String& relative_path) {
return FilePathToWebString(
BlinkRootFilePath()
.Append(FILE_PATH_LITERAL("Source/core/testing/data"))
.Append(FILE_PATH_LITERAL("renderer/core/testing/data"))
.Append(WebStringToFilePath(relative_path)));
}
String PlatformTestDataPath(const String& relative_path) {
return FilePathToWebString(
BlinkRootFilePath()
.Append(FILE_PATH_LITERAL("Source/platform/testing/data"))
.Append(FILE_PATH_LITERAL("renderer/platform/testing/data"))
.Append(WebStringToFilePath(relative_path)));
}
......
......@@ -49,9 +49,13 @@ void ExitRunLoop();
void YieldCurrentThread();
// Returns Blink top directory as an absolute path, e.g.
// /src/third_party/WebKit.
// /src/third_party/blink.
String BlinkRootDir();
// Returns Blink LayoutTests directory as an absolute path, e.g.
// /src/third_party/WebKit/LayoutTests.
String BlinkLayoutTestsDir();
// Returns directory containing the current executable as absolute path.
String ExecutableDir();
......
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