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

Side by Side Diff: net/url_request/sdch_dictionary_fetcher_unittest.cc

Issue 423813002: Sdch view for net-internals (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix component linkage Created 6 years, 1 month 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 | « net/url_request/sdch_dictionary_fetcher.cc ('k') | net/url_request/url_request_http_job.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "net/url_request/sdch_dictionary_fetcher.h" 5 #include "net/url_request/sdch_dictionary_fetcher.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 context_.get(), 92 context_.get(),
93 base::Bind(&SdchDictionaryFetcherTest::OnDictionaryFetched, 93 base::Bind(&SdchDictionaryFetcherTest::OnDictionaryFetched,
94 base::Unretained(this)))); 94 base::Unretained(this))));
95 } 95 }
96 96
97 ~SdchDictionaryFetcherTest() { 97 ~SdchDictionaryFetcherTest() {
98 URLRequestSpecifiedResponseJob::RemoveUrlHandler(); 98 URLRequestSpecifiedResponseJob::RemoveUrlHandler();
99 } 99 }
100 100
101 void OnDictionaryFetched(const std::string& dictionary_text, 101 void OnDictionaryFetched(const std::string& dictionary_text,
102 const GURL& dictionary_url) { 102 const GURL& dictionary_url,
103 const BoundNetLog& net_log) {
103 dictionary_additions.push_back( 104 dictionary_additions.push_back(
104 DictionaryAdditions(dictionary_text, dictionary_url)); 105 DictionaryAdditions(dictionary_text, dictionary_url));
105 } 106 }
106 107
107 void GetDictionaryAdditions(std::vector<DictionaryAdditions>* out) { 108 void GetDictionaryAdditions(std::vector<DictionaryAdditions>* out) {
108 out->swap(dictionary_additions); 109 out->swap(dictionary_additions);
109 dictionary_additions.clear(); 110 dictionary_additions.clear();
110 } 111 }
111 112
112 SdchDictionaryFetcher* fetcher() { return fetcher_.get(); } 113 SdchDictionaryFetcher* fetcher() { return fetcher_.get(); }
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 fetcher()->Schedule(dictionary_url_1); 172 fetcher()->Schedule(dictionary_url_1);
172 fetcher()->Schedule(dictionary_url_2); 173 fetcher()->Schedule(dictionary_url_2);
173 fetcher()->Schedule(dictionary_url_3); 174 fetcher()->Schedule(dictionary_url_3);
174 fetcher()->Cancel(); 175 fetcher()->Cancel();
175 base::RunLoop().RunUntilIdle(); 176 base::RunLoop().RunUntilIdle();
176 177
177 // Synchronous execution may have resulted in a single job being scheduled. 178 // Synchronous execution may have resulted in a single job being scheduled.
178 EXPECT_GE(1, JobsRequested()); 179 EXPECT_GE(1, JobsRequested());
179 } 180 }
180 } 181 }
OLDNEW
« no previous file with comments | « net/url_request/sdch_dictionary_fetcher.cc ('k') | net/url_request/url_request_http_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698