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

Side by Side Diff: third_party/libaddressinput/chromium/chrome_metadata_source_unittest.cc

Issue 2107163003: Remove calls to deprecated MessageLoop methods in third_party. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
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 "third_party/libaddressinput/chromium/chrome_metadata_source.h" 5 #include "third_party/libaddressinput/chromium/chrome_metadata_source.h"
6 6
7 #include "base/run_loop.h"
7 #include "base/threading/thread_task_runner_handle.h" 8 #include "base/threading/thread_task_runner_handle.h"
8 #include "net/url_request/test_url_fetcher_factory.h" 9 #include "net/url_request/test_url_fetcher_factory.h"
9 #include "net/url_request/url_request_test_util.h" 10 #include "net/url_request/url_request_test_util.h"
10 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
11 12
12 namespace autofill { 13 namespace autofill {
13 14
14 static const char kFakeUrl[] = "https://example.com"; 15 static const char kFakeUrl[] = "https://example.com";
15 static const char kFakeInsecureUrl[] = "http://example.com"; 16 static const char kFakeInsecureUrl[] = "http://example.com";
16 17
(...skipping 16 matching lines...) Expand all
33 // Kicks off the download. 34 // Kicks off the download.
34 void Get() { 35 void Get() {
35 scoped_refptr<net::TestURLRequestContextGetter> getter( 36 scoped_refptr<net::TestURLRequestContextGetter> getter(
36 new net::TestURLRequestContextGetter( 37 new net::TestURLRequestContextGetter(
37 base::ThreadTaskRunnerHandle::Get())); 38 base::ThreadTaskRunnerHandle::Get()));
38 ChromeMetadataSource impl(std::string(), getter.get()); 39 ChromeMetadataSource impl(std::string(), getter.get());
39 std::unique_ptr<::i18n::addressinput::Source::Callback> callback( 40 std::unique_ptr<::i18n::addressinput::Source::Callback> callback(
40 ::i18n::addressinput::BuildCallback( 41 ::i18n::addressinput::BuildCallback(
41 this, &ChromeMetadataSourceTest::OnDownloaded)); 42 this, &ChromeMetadataSourceTest::OnDownloaded));
42 impl.Get(url_.spec(), *callback); 43 impl.Get(url_.spec(), *callback);
43 base::MessageLoop::current()->RunUntilIdle(); 44 base::RunLoop().RunUntilIdle();
44 } 45 }
45 46
46 void set_url(const GURL& url) { url_ = url; } 47 void set_url(const GURL& url) { url_ = url; }
47 bool success() const { return success_; } 48 bool success() const { return success_; }
48 bool has_data() const { return !!data_; } 49 bool has_data() const { return !!data_; }
49 50
50 const std::string& data() const { 51 const std::string& data() const {
51 DCHECK(data_); 52 DCHECK(data_);
52 return *data_; 53 return *data_;
53 } 54 }
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 TEST_F(ChromeMetadataSourceTest, RejectsInsecureScheme) { 92 TEST_F(ChromeMetadataSourceTest, RejectsInsecureScheme) {
92 const char kFakePayload[] = "ham hock"; 93 const char kFakePayload[] = "ham hock";
93 set_url(GURL(kFakeInsecureUrl)); 94 set_url(GURL(kFakeInsecureUrl));
94 SetFakeResponse(kFakePayload, net::HTTP_OK); 95 SetFakeResponse(kFakePayload, net::HTTP_OK);
95 Get(); 96 Get();
96 EXPECT_FALSE(success()); 97 EXPECT_FALSE(success());
97 EXPECT_TRUE(!has_data() || data().empty()); 98 EXPECT_TRUE(!has_data() || data().empty());
98 } 99 }
99 100
100 } // namespace autofill 101 } // namespace autofill
OLDNEW
« no previous file with comments | « third_party/libaddressinput/chromium/chrome_address_validator.cc ('k') | third_party/zlib/google/zip_reader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698