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

Side by Side Diff: chrome/browser/webshare/share_service_impl_unittest.cc

Issue 2589663003: mojo:: Rename mojo::GetProxy() to mojo::MakeRequest() (Closed)
Patch Set: Rebase Created 4 years 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/callback.h" 6 #include "base/callback.h"
7 #include "base/run_loop.h" 7 #include "base/run_loop.h"
8 #include "chrome/browser/webshare/share_service_impl.h" 8 #include "chrome/browser/webshare/share_service_impl.h"
9 #include "chrome/test/base/chrome_render_view_host_test_harness.h" 9 #include "chrome/test/base/chrome_render_view_host_test_harness.h"
10 #include "mojo/public/cpp/bindings/interface_request.h" 10 #include "mojo/public/cpp/bindings/interface_request.h"
11 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
12 #include "url/gurl.h" 12 #include "url/gurl.h"
13 13
14 class ShareServiceTest : public ChromeRenderViewHostTestHarness { 14 class ShareServiceTest : public ChromeRenderViewHostTestHarness {
15 public: 15 public:
16 ShareServiceTest() = default; 16 ShareServiceTest() = default;
17 ~ShareServiceTest() override = default; 17 ~ShareServiceTest() override = default;
18 18
19 void SetUp() override { 19 void SetUp() override {
20 ChromeRenderViewHostTestHarness::SetUp(); 20 ChromeRenderViewHostTestHarness::SetUp();
21 21
22 ShareServiceImpl::Create(mojo::GetProxy(&share_service_)); 22 ShareServiceImpl::Create(mojo::MakeRequest(&share_service_));
23 } 23 }
24 24
25 void TearDown() override { 25 void TearDown() override {
26 ChromeRenderViewHostTestHarness::TearDown(); 26 ChromeRenderViewHostTestHarness::TearDown();
27 } 27 }
28 28
29 void DidShare(const base::Optional<std::string>& expected, 29 void DidShare(const base::Optional<std::string>& expected,
30 const base::Optional<std::string>& str) { 30 const base::Optional<std::string>& str) {
31 EXPECT_EQ(expected, str); 31 EXPECT_EQ(expected, str);
32 32
(...skipping 14 matching lines...) Expand all
47 on_callback_ = run_loop.QuitClosure(); 47 on_callback_ = run_loop.QuitClosure();
48 48
49 base::Callback<void(const base::Optional<std::string>&)> callback = 49 base::Callback<void(const base::Optional<std::string>&)> callback =
50 base::Bind( 50 base::Bind(
51 &ShareServiceTest::DidShare, base::Unretained(this), 51 &ShareServiceTest::DidShare, base::Unretained(this),
52 base::Optional<std::string>("Not implemented: navigator.share")); 52 base::Optional<std::string>("Not implemented: navigator.share"));
53 share_service_->Share("title", "text", url, callback); 53 share_service_->Share("title", "text", url, callback);
54 54
55 run_loop.Run(); 55 run_loop.Run();
56 } 56 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/ime_driver/input_method_bridge_chromeos_unittest.cc ('k') | chrome/gpu/gpu_arc_video_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698