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

Side by Side Diff: components/dom_distiller/content/distillable_page_utils_browsertest.cc

Issue 1075783002: Enable components_browsertests on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix GN build and add java dependency to components/test/DEPS Created 5 years, 8 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/path_service.h" 6 #include "base/path_service.h"
7 #include "base/run_loop.h" 7 #include "base/run_loop.h"
8 #include "components/dom_distiller/content/distillable_page_utils.h" 8 #include "components/dom_distiller/content/distillable_page_utils.h"
9 #include "components/dom_distiller/core/distillable_page_detector.h" 9 #include "components/dom_distiller/core/distillable_page_detector.h"
10 #include "components/dom_distiller/core/page_features.h" 10 #include "components/dom_distiller/core/page_features.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 std::string()); 43 std::string());
44 url_loaded_runner.Run(); 44 url_loaded_runner.Run();
45 main_frame_loaded_callback_ = base::Closure(); 45 main_frame_loaded_callback_ = base::Closure();
46 Observe(nullptr); 46 Observe(nullptr);
47 } 47 }
48 48
49 private: 49 private:
50 void AddComponentsResources() { 50 void AddComponentsResources() {
51 base::FilePath pak_file; 51 base::FilePath pak_file;
52 base::FilePath pak_dir; 52 base::FilePath pak_dir;
53 #if defined(OS_ANDROID)
54 CHECK(PathService::Get(base::DIR_ANDROID_APP_DATA, &pak_dir));
55 pak_dir = pak_dir.Append(FILE_PATH_LITERAL("paks"));
56 #else
53 PathService::Get(base::DIR_MODULE, &pak_dir); 57 PathService::Get(base::DIR_MODULE, &pak_dir);
58 #endif // OS_ANDROID
54 pak_file = 59 pak_file =
55 pak_dir.Append(FILE_PATH_LITERAL("components_tests_resources.pak")); 60 pak_dir.Append(FILE_PATH_LITERAL("components_tests_resources.pak"));
56 ui::ResourceBundle::GetSharedInstance().AddDataPackFromPath( 61 ui::ResourceBundle::GetSharedInstance().AddDataPackFromPath(
57 pak_file, ui::SCALE_FACTOR_NONE); 62 pak_file, ui::SCALE_FACTOR_NONE);
58 } 63 }
59 64
60 void SetUpTestServer() { 65 void SetUpTestServer() {
61 base::FilePath path; 66 base::FilePath path;
62 PathService::Get(base::DIR_SOURCE_ROOT, &path); 67 PathService::Get(base::DIR_SOURCE_ROOT, &path);
63 path = path.AppendASCII("components/test/data/dom_distiller"); 68 path = path.AppendASCII("components/test/data/dom_distiller");
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 LoadURL(kArticlePath); 165 LoadURL(kArticlePath);
161 base::RunLoop run_loop_; 166 base::RunLoop run_loop_;
162 ResultHolder holder(run_loop_.QuitClosure()); 167 ResultHolder holder(run_loop_.QuitClosure());
163 IsDistillablePageForDetector(shell()->web_contents(), detector.get(), 168 IsDistillablePageForDetector(shell()->web_contents(), detector.get(),
164 holder.GetCallback()); 169 holder.GetCallback());
165 run_loop_.Run(); 170 run_loop_.Run();
166 ASSERT_FALSE(holder.GetResult()); 171 ASSERT_FALSE(holder.GetResult());
167 } 172 }
168 173
169 } // namespace dom_distiller 174 } // namespace dom_distiller
OLDNEW
« no previous file with comments | « components/components_tests.gyp ('k') | components/dom_distiller/content/distiller_page_web_contents_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698