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

Unified Diff: chrome/browser/android/contextualsearch/contextual_search_delegate_unittest.cc

Issue 2706333002: [TTS] Add a Java Context linked to existing native (Closed)
Patch Set: DCHECK that the context is created on the browser thread. Created 3 years, 9 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/android/contextualsearch/contextual_search_delegate_unittest.cc
diff --git a/chrome/browser/android/contextualsearch/contextual_search_delegate_unittest.cc b/chrome/browser/android/contextualsearch/contextual_search_delegate_unittest.cc
index 5646a65aeb12afe13cd22820ce49bc34110665be..73998ba776b2437f635a542cddb9b309fbd99bf1 100644
--- a/chrome/browser/android/contextualsearch/contextual_search_delegate_unittest.cc
+++ b/chrome/browser/android/contextualsearch/contextual_search_delegate_unittest.cc
@@ -90,15 +90,15 @@ class ContextualSearchDelegateTest : public testing::Test {
const base::string16& surrounding_text,
int start_offset,
int end_offset) {
- test_context_ = new ContextualSearchContext(
- selected_text, std::string(), GURL(kSomeSpecificBasePage), "utf-8");
+ test_context_ = new ContextualSearchContext();
+ test_context_->SetPropertiesInternal(selected_text, std::string(), true);
// ContextualSearchDelegate class takes ownership of the context.
delegate_->set_context_for_testing(test_context_);
test_context_->start_offset = start_offset;
test_context_->end_offset = end_offset;
test_context_->surrounding_text = surrounding_text;
- delegate_->ContinueSearchTermResolutionRequest();
+ delegate_->ResolveSearchTermFromContext();
fetcher_ = test_factory_.GetFetcherByID(
ContextualSearchDelegate::kContextualSearchURLFetcherID);
ASSERT_TRUE(fetcher_);
@@ -145,8 +145,8 @@ class ContextualSearchDelegateTest : public testing::Test {
void SetSurroundingContext(const base::string16& surrounding_text,
int start_offset,
int end_offset) {
- test_context_ = new ContextualSearchContext(
- "Bogus", std::string(), GURL(kSomeSpecificBasePage), "utf-8");
+ test_context_ = new ContextualSearchContext();
+ test_context_->SetPropertiesInternal("Bogus", std::string(), true);
test_context_->surrounding_text = surrounding_text;
test_context_->start_offset = start_offset;
test_context_->end_offset = end_offset;

Powered by Google App Engine
This is Rietveld 408576698