| Index: chrome/browser/webshare/share_service_impl_unittest.cc
|
| diff --git a/chrome/browser/webshare/share_service_impl_unittest.cc b/chrome/browser/webshare/share_service_impl_unittest.cc
|
| index 0e6eaf5657dc9ee0e68d4d11a0548bfc2096ea51..1bf936b8c40a389d7b0fc6fc6d2c78337cc2d8a8 100644
|
| --- a/chrome/browser/webshare/share_service_impl_unittest.cc
|
| +++ b/chrome/browser/webshare/share_service_impl_unittest.cc
|
| @@ -7,6 +7,7 @@
|
| #include "base/bind.h"
|
| #include "base/callback.h"
|
| #include "base/run_loop.h"
|
| +#include "base/strings/utf_string_conversions.h"
|
| #include "chrome/browser/webshare/share_service_impl.h"
|
| #include "chrome/test/base/chrome_render_view_host_test_harness.h"
|
| #include "mojo/public/cpp/bindings/interface_request.h"
|
| @@ -32,19 +33,20 @@ class ShareServiceTestImpl : public ShareServiceImpl {
|
| return share_service_helper_raw;
|
| }
|
|
|
| - void set_picker_result(SharePickerResult result) {
|
| + void set_picker_result(base::Optional<base::string16> result) {
|
| picker_result_ = result;
|
| }
|
|
|
| const std::string& GetLastUsedTargetURL() { return last_used_target_url_; }
|
|
|
| private:
|
| - SharePickerResult picker_result_ = SharePickerResult::SHARE;
|
| + base::Optional<base::string16> picker_result_ = base::nullopt;
|
| std::string last_used_target_url_;
|
|
|
| void ShowPickerDialog(
|
| const std::vector<base::string16>& targets,
|
| - const base::Callback<void(SharePickerResult)>& callback) override {
|
| + const base::Callback<void(base::Optional<base::string16>)>& callback)
|
| + override {
|
| callback.Run(picker_result_);
|
| }
|
|
|
| @@ -92,6 +94,8 @@ TEST_F(ShareServiceImplUnittest, ShareCallbackParams) {
|
| "https://wicg.github.io/web-share-target/demos/"
|
| "sharetarget.html?title=My%20title&text=My%20text&url=https%3A%2F%2Fwww."
|
| "google.com%2F";
|
| + share_service_helper_->set_picker_result(
|
| + base::ASCIIToUTF16("https://wicg.github.io/web-share-target/demos/"));
|
|
|
| const GURL url(kUrlSpec);
|
| base::Callback<void(const base::Optional<std::string>&)> callback =
|
| @@ -109,7 +113,7 @@ TEST_F(ShareServiceImplUnittest, ShareCallbackParams) {
|
| // Tests the result of cancelling the share in the picker UI.
|
| TEST_F(ShareServiceImplUnittest, ShareCancel) {
|
| // Ask that the dialog be cancelled.
|
| - share_service_helper_->set_picker_result(SharePickerResult::CANCEL);
|
| + share_service_helper_->set_picker_result(base::nullopt);
|
|
|
| // Expect an error message in response.
|
| base::Callback<void(const base::Optional<std::string>&)> callback =
|
|
|