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

Side by Side Diff: chrome/common/extensions/extension_file_util_unittest.cc

Issue 12314090: Add utf_string_conversions to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/common/extensions/extension_file_util.h" 5 #include "chrome/common/extensions/extension_file_util.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/files/scoped_temp_dir.h" 8 #include "base/files/scoped_temp_dir.h"
9 #include "base/json/json_string_value_serializer.h" 9 #include "base/json/json_string_value_serializer.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 "foo/simple.html" }, 293 "foo/simple.html" },
294 }; 294 };
295 #undef URL_PREFIX 295 #undef URL_PREFIX
296 296
297 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_cases); ++i) { 297 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_cases); ++i) {
298 GURL url(test_cases[i].url); 298 GURL url(test_cases[i].url);
299 #if defined(OS_POSIX) 299 #if defined(OS_POSIX)
300 base::FilePath expected_path(test_cases[i].expected_relative_path); 300 base::FilePath expected_path(test_cases[i].expected_relative_path);
301 #elif defined(OS_WIN) 301 #elif defined(OS_WIN)
302 base::FilePath expected_path( 302 base::FilePath expected_path(
303 UTF8ToWide(test_cases[i].expected_relative_path)); 303 base::UTF8ToWide(test_cases[i].expected_relative_path));
304 #endif 304 #endif
305 305
306 base::FilePath actual_path = 306 base::FilePath actual_path =
307 extension_file_util::ExtensionURLToRelativeFilePath(url); 307 extension_file_util::ExtensionURLToRelativeFilePath(url);
308 EXPECT_FALSE(actual_path.IsAbsolute()) << 308 EXPECT_FALSE(actual_path.IsAbsolute()) <<
309 " For the path " << actual_path.value(); 309 " For the path " << actual_path.value();
310 EXPECT_EQ(expected_path.value(), actual_path.value()) << 310 EXPECT_EQ(expected_path.value(), actual_path.value()) <<
311 " For the path " << url; 311 " For the path " << url;
312 } 312 }
313 } 313 }
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
615 scoped_refptr<Extension> extension3(extension_file_util::LoadExtension( 615 scoped_refptr<Extension> extension3(extension_file_util::LoadExtension(
616 ext_dir, Manifest::LOAD, Extension::NO_FLAGS, &error)); 616 ext_dir, Manifest::LOAD, Extension::NO_FLAGS, &error));
617 ASSERT_TRUE(extension3 == NULL); 617 ASSERT_TRUE(extension3 == NULL);
618 ASSERT_STREQ("Could not load icon 'icon.png' for page action.", 618 ASSERT_STREQ("Could not load icon 'icon.png' for page action.",
619 error.c_str()); 619 error.c_str());
620 } 620 }
621 621
622 // TODO(aa): More tests as motivation allows. Maybe steal some from 622 // TODO(aa): More tests as motivation allows. Maybe steal some from
623 // ExtensionService? Many of them could probably be tested here without the 623 // ExtensionService? Many of them could probably be tested here without the
624 // MessageLoop shenanigans. 624 // MessageLoop shenanigans.
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698