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

Unified Diff: chrome/browser/translate/component_cld_data_harness.cc

Issue 461633002: Refactor language detection logic to allow non-static CLD data sources. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix merge error in chrome/browser/BUILD.gn Created 6 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
Index: chrome/browser/translate/component_cld_data_harness.cc
diff --git a/chrome/browser/translate/component_cld_data_harness.cc b/chrome/browser/translate/component_cld_data_harness.cc
index 3da8b5fdb58498fe8439902df4e4bef557f11590..75965148c229f0d9ed7777dd3d92981d4812e499 100644
--- a/chrome/browser/translate/component_cld_data_harness.cc
+++ b/chrome/browser/translate/component_cld_data_harness.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "component_cld_data_harness.h"
+#include "chrome/browser/translate/component_cld_data_harness.h"
#include "base/base_paths.h"
#include "base/files/file_util.h"
@@ -10,6 +10,8 @@
#include "base/path_service.h"
#include "chrome/browser/component_updater/cld_component_installer.h"
#include "chrome/common/chrome_paths.h"
+#include "components/component_updater/component_updater_paths.h"
+#include "components/translate/content/common/cld_data_source.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace {
@@ -38,6 +40,7 @@ ComponentCldDataHarness::~ComponentCldDataHarness() {
void ComponentCldDataHarness::Init() {
VLOG(1) << "Initializing CLD data harness";
// Dynamic data mode is enabled and we are using the component updater.
+ translate::CldDataSource::Set(translate::CldDataSource::COMPONENT(), true);
ASSERT_NO_FATAL_FAILURE(CopyComponentTree());
base::FilePath data_file;
GetComponentDataFileDestination(&data_file);
@@ -56,7 +59,8 @@ void ComponentCldDataHarness::ClearComponentDataFileState() {
// parallel test processes.
void ComponentCldDataHarness::GetExtractedComponentDestination(
base::FilePath* out_path) {
- ASSERT_TRUE(PathService::Get(chrome::DIR_COMPONENT_CLD2, out_path));
+ ASSERT_TRUE(PathService::Get(component_updater::DIR_COMPONENT_CLD2,
+ out_path));
}
void ComponentCldDataHarness::GetComponentDataFileDestination(
@@ -91,9 +95,4 @@ void ComponentCldDataHarness::CopyComponentTree() {
ASSERT_TRUE(base::PathExists(check_path));
}
-scoped_ptr<CldDataHarness> CreateCldDataHarness() {
- scoped_ptr<CldDataHarness> result(new ComponentCldDataHarness());
- return result.Pass();
-}
-
} // namespace test

Powered by Google App Engine
This is Rietveld 408576698