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

Unified Diff: chrome/browser/extensions/file_reader_unittest.cc

Issue 256022: Loads local resources from current locale subtree if available, if not it fal... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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/browser/extensions/file_reader.cc ('k') | chrome/browser/extensions/image_loading_tracker.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/file_reader_unittest.cc
===================================================================
--- chrome/browser/extensions/file_reader_unittest.cc (revision 28157)
+++ chrome/browser/extensions/file_reader_unittest.cc (working copy)
@@ -2,12 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/file_path.h"
#include "base/file_util.h"
#include "base/message_loop.h"
#include "base/path_service.h"
#include "chrome/browser/chrome_thread.h"
-#include "chrome/browser/net/file_reader.h"
+#include "chrome/browser/extensions/file_reader.h"
#include "chrome/common/chrome_paths.h"
+#include "chrome/common/extensions/extension_resource.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace {
@@ -48,6 +50,7 @@
void RunBasicTest(const char* filename) {
FilePath path;
PathService::Get(chrome::DIR_TEST_DATA, &path);
+ ExtensionResource resource(path, FilePath().AppendASCII(filename));
path = path.AppendASCII(filename);
std::string file_contents;
@@ -56,7 +59,7 @@
Receiver receiver;
scoped_refptr<FileReader> file_reader(
- new FileReader(path, receiver.NewCallback()));
+ new FileReader(resource, receiver.NewCallback()));
file_reader->Start();
MessageLoop::current()->Run();
@@ -76,12 +79,14 @@
TEST_F(FileReaderTest, NonExistantFile) {
FilePath path;
PathService::Get(chrome::DIR_TEST_DATA, &path);
+ ExtensionResource resource(path, FilePath(
+ FILE_PATH_LITERAL("file_that_does_not_exist")));
path = path.AppendASCII("file_that_does_not_exist");
Receiver receiver;
scoped_refptr<FileReader> file_reader(
- new FileReader(path, receiver.NewCallback()));
+ new FileReader(resource, receiver.NewCallback()));
file_reader->Start();
MessageLoop::current()->Run();
« no previous file with comments | « chrome/browser/extensions/file_reader.cc ('k') | chrome/browser/extensions/image_loading_tracker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698