Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3458)

Unified Diff: chrome/test/ui/ui_layout_test.cc

Issue 3160027: Set state of a new audio stream to paused until it starts playing. (Closed)
Patch Set: - Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/renderer/media/audio_renderer_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/ui/ui_layout_test.cc
diff --git a/chrome/test/ui/ui_layout_test.cc b/chrome/test/ui/ui_layout_test.cc
index e0fe7e5243f3b53d83f016d24d190cb66965d1b5..548d9cda711d6bf18e8fc59bbbd444a591ec9085 100644
--- a/chrome/test/ui/ui_layout_test.cc
+++ b/chrome/test/ui/ui_layout_test.cc
@@ -137,24 +137,30 @@ void UILayoutTest::InitializeForLayoutTest(const FilePath& test_parent_dir,
}
void UILayoutTest::AddResourceForLayoutTest(const FilePath& parent_dir,
- const FilePath& resource_dir) {
+ const FilePath& resource_name) {
FilePath root_dir;
PathService::Get(base::DIR_SOURCE_ROOT, &root_dir);
- FilePath src_dir = root_dir.AppendASCII("chrome");
- src_dir = src_dir.AppendASCII("test");
- src_dir = src_dir.AppendASCII("data");
- src_dir = src_dir.AppendASCII("layout_tests");
- src_dir = src_dir.AppendASCII("LayoutTests");
- src_dir = src_dir.Append(parent_dir);
- src_dir = src_dir.Append(resource_dir);
- ASSERT_TRUE(file_util::DirectoryExists(src_dir));
+ FilePath source = root_dir.AppendASCII("chrome");
+ source = source.AppendASCII("test");
+ source = source.AppendASCII("data");
+ source = source.AppendASCII("layout_tests");
+ source = source.AppendASCII("LayoutTests");
+ source = source.Append(parent_dir);
+ source = source.Append(resource_name);
+
+ ASSERT_TRUE(file_util::PathExists(source));
FilePath dest_parent_dir = temp_test_dir_.
AppendASCII("LayoutTests").Append(parent_dir);
ASSERT_TRUE(file_util::CreateDirectory(dest_parent_dir));
- FilePath dest_dir = dest_parent_dir.Append(resource_dir);
- ASSERT_TRUE(file_util::CopyDirectory(src_dir, dest_dir, true));
+ FilePath dest = dest_parent_dir.Append(resource_name);
+
+ if (file_util::DirectoryExists(source)) {
+ ASSERT_TRUE(file_util::CopyDirectory(source, dest, true));
+ } else {
+ ASSERT_TRUE(file_util::CopyFile(source, dest));
+ }
}
static size_t FindInsertPosition(const std::string& html) {
« no previous file with comments | « chrome/renderer/media/audio_renderer_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698