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

Side by Side Diff: content/test/test_content_client.cc

Issue 10907198: Do not load content_resources.pak on iOS. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "content/test/test_content_client.h" 5 #include "content/test/test_content_client.h"
6 6
7 #include "base/base_paths.h" 7 #include "base/base_paths.h"
8 #include "base/file_path.h" 8 #include "base/file_path.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
11 #include "base/string_piece.h" 11 #include "base/string_piece.h"
12 12
13 TestContentClient::TestContentClient() 13 TestContentClient::TestContentClient()
14 : data_pack_(ui::SCALE_FACTOR_100P) { 14 : data_pack_(ui::SCALE_FACTOR_100P) {
15 // content_resources.pak is not built on iOS as it is not required. Avoid
16 // loading it for tests to avoid confusion.
stuartmorgan 2012/09/13 14:40:39 Remove the second sentence.
17 #if !defined(OS_IOS)
15 FilePath content_resources_pack_path; 18 FilePath content_resources_pack_path;
16 PathService::Get(base::DIR_MODULE, &content_resources_pack_path); 19 PathService::Get(base::DIR_MODULE, &content_resources_pack_path);
17 content_resources_pack_path = content_resources_pack_path.Append( 20 content_resources_pack_path = content_resources_pack_path.Append(
18 FILE_PATH_LITERAL("content_resources.pak")); 21 FILE_PATH_LITERAL("content_resources.pak"));
19 data_pack_.LoadFromPath(content_resources_pack_path); 22 data_pack_.LoadFromPath(content_resources_pack_path);
23 #endif
20 } 24 }
21 25
22 TestContentClient::~TestContentClient() { 26 TestContentClient::~TestContentClient() {
23 } 27 }
24 28
25 std::string TestContentClient::GetUserAgent() const { 29 std::string TestContentClient::GetUserAgent() const {
26 return std::string("TestContentClient"); 30 return std::string("TestContentClient");
27 } 31 }
28 32
29 base::StringPiece TestContentClient::GetDataResource( 33 base::StringPiece TestContentClient::GetDataResource(
30 int resource_id, 34 int resource_id,
31 ui::ScaleFactor scale_factor) const { 35 ui::ScaleFactor scale_factor) const {
32 base::StringPiece resource; 36 base::StringPiece resource;
33 data_pack_.GetStringPiece(resource_id, &resource); 37 data_pack_.GetStringPiece(resource_id, &resource);
34 return resource; 38 return resource;
35 } 39 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698