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

Side by Side Diff: chrome/test/data/webui/webui_resource_browsertest.cc

Issue 1968993002: Compressing .pak resources with new option: "type=GZIPPABLE_BINDATA" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed Python formatting Created 4 years, 6 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <vector> 5 #include <vector>
6 6
7 #include "base/path_service.h" 7 #include "base/path_service.h"
8 #include "chrome/browser/ui/browser.h" 8 #include "chrome/browser/ui/browser.h"
9 #include "chrome/browser/ui/tabs/tab_strip_model.h" 9 #include "chrome/browser/ui/tabs/tab_strip_model.h"
10 #include "chrome/grit/options_test_resources.h" 10 #include "chrome/grit/options_test_resources.h"
(...skipping 18 matching lines...) Expand all
29 } 29 }
30 30
31 // Runs all test functions in |file|, waiting for them to complete. 31 // Runs all test functions in |file|, waiting for them to complete.
32 void LoadFile(const base::FilePath& file) { 32 void LoadFile(const base::FilePath& file) {
33 base::FilePath webui(FILE_PATH_LITERAL("webui")); 33 base::FilePath webui(FILE_PATH_LITERAL("webui"));
34 RunTest(ui_test_utils::GetTestUrl(webui, file)); 34 RunTest(ui_test_utils::GetTestUrl(webui, file));
35 } 35 }
36 36
37 void LoadResource(int idr) { 37 void LoadResource(int idr) {
38 ResourceBundle& bundle = ResourceBundle::GetSharedInstance(); 38 ResourceBundle& bundle = ResourceBundle::GetSharedInstance();
39 base::StringPiece resource = bundle.GetRawDataResource(idr); 39 scoped_refptr<base::RefCountedMemory> resource =
40 RunTest(GURL(std::string("data:text/html,") + resource.as_string())); 40 bundle.LoadDataResourceBytes(idr);
41 RunTest(GURL(std::string("data:text/html,") +
42 std::string(resource->front_as<char>(), resource->size())));
41 } 43 }
42 44
43 // Queues the library corresponding to |resource_id| for injection into the 45 // Queues the library corresponding to |resource_id| for injection into the
44 // test. The code injection is performed post-load, so any common test 46 // test. The code injection is performed post-load, so any common test
45 // initialization that depends on the library should be placed in a setUp 47 // initialization that depends on the library should be placed in a setUp
46 // function. 48 // function.
47 void AddLibrary(int resource_id) { 49 void AddLibrary(int resource_id) {
48 include_libraries_.push_back(resource_id); 50 include_libraries_.push_back(resource_id);
49 } 51 }
50 52
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 AddLibrary(IDR_WEBUI_JS_PROMISE_RESOLVER); 254 AddLibrary(IDR_WEBUI_JS_PROMISE_RESOLVER);
253 LoadFile(base::FilePath(FILE_PATH_LITERAL("promise_resolver_test.html"))); 255 LoadFile(base::FilePath(FILE_PATH_LITERAL("promise_resolver_test.html")));
254 } 256 }
255 257
256 IN_PROC_BROWSER_TEST_F(WebUIResourceBrowserTest, I18nBehaviorTest) { 258 IN_PROC_BROWSER_TEST_F(WebUIResourceBrowserTest, I18nBehaviorTest) {
257 AddLibrary(IDR_WEBUI_JS_LOAD_TIME_DATA); 259 AddLibrary(IDR_WEBUI_JS_LOAD_TIME_DATA);
258 AddLibrary(IDR_WEBUI_JS_PARSE_HTML_SUBSET); 260 AddLibrary(IDR_WEBUI_JS_PARSE_HTML_SUBSET);
259 AddLibrary(IDR_WEBUI_JS_I18N_BEHAVIOR); 261 AddLibrary(IDR_WEBUI_JS_I18N_BEHAVIOR);
260 LoadFile(base::FilePath(FILE_PATH_LITERAL("i18n_behavior_test.html"))); 262 LoadFile(base::FilePath(FILE_PATH_LITERAL("i18n_behavior_test.html")));
261 } 263 }
OLDNEW
« no previous file with comments | « chrome/browser/resources/translate_internals_resources.grd ('k') | components/resources/gcm_driver_resources.grdp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698