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

Side by Side Diff: http_fetcher_unittest.cc

Issue 3036005: AU: HTTP success is not just 200, but anything in the 2xx range (Closed) Base URL: ssh://git@chromiumos-git/update_engine.git
Patch Set: Created 10 years, 5 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
« no previous file with comments | « no previous file | libcurl_http_fetcher.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 (c) 2009 The Chromium OS Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium OS 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 <unistd.h> 5 #include <unistd.h>
6 #include <string> 6 #include <string>
7 #include <vector> 7 #include <vector>
8 #include <base/scoped_ptr.h> 8 #include <base/scoped_ptr.h>
9 #include <glib.h> 9 #include <glib.h>
10 #include <gtest/gtest.h> 10 #include <gtest/gtest.h>
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 } 332 }
333 333
334 namespace { 334 namespace {
335 class FlakyHttpFetcherTestDelegate : public HttpFetcherDelegate { 335 class FlakyHttpFetcherTestDelegate : public HttpFetcherDelegate {
336 public: 336 public:
337 virtual void ReceivedBytes(HttpFetcher* fetcher, 337 virtual void ReceivedBytes(HttpFetcher* fetcher,
338 const char* bytes, int length) { 338 const char* bytes, int length) {
339 data.append(bytes, length); 339 data.append(bytes, length);
340 } 340 }
341 virtual void TransferComplete(HttpFetcher* fetcher, bool successful) { 341 virtual void TransferComplete(HttpFetcher* fetcher, bool successful) {
342 EXPECT_TRUE(successful);
342 g_main_loop_quit(loop_); 343 g_main_loop_quit(loop_);
343 } 344 }
344 string data; 345 string data;
345 GMainLoop* loop_; 346 GMainLoop* loop_;
346 }; 347 };
347 } // namespace {} 348 } // namespace {}
348 349
349 TYPED_TEST(HttpFetcherTest, FlakyTest) { 350 TYPED_TEST(HttpFetcherTest, FlakyTest) {
350 if (this->IsMock()) 351 if (this->IsMock())
351 return; 352 return;
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 442
442 g_timeout_add(0, StartTransfer, &start_xfer_args); 443 g_timeout_add(0, StartTransfer, &start_xfer_args);
443 g_main_loop_run(loop); 444 g_main_loop_run(loop);
444 445
445 // Exiting and testing happens in the delegate 446 // Exiting and testing happens in the delegate
446 } 447 }
447 g_main_loop_unref(loop); 448 g_main_loop_unref(loop);
448 } 449 }
449 450
450 } // namespace chromeos_update_engine 451 } // namespace chromeos_update_engine
OLDNEW
« no previous file with comments | « no previous file | libcurl_http_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698