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

Side by Side Diff: chrome/browser/chromeos/arc/arc_policy_bridge_unittest.cc

Issue 1863283002: Make mojo::Callback<>::Runnable::Run non-const. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 4 years, 8 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 | mojo/public/cpp/bindings/callback.h » ('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 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 <memory> 5 #include <memory>
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "chrome/browser/chromeos/arc/arc_policy_bridge.h" 9 #include "chrome/browser/chromeos/arc/arc_policy_bridge.h"
10 #include "components/arc/test/fake_arc_bridge_service.h" 10 #include "components/arc/test/fake_arc_bridge_service.h"
(...skipping 23 matching lines...) Expand all
34 policy::POLICY_DOMAIN_CHROME, std::string()))) 34 policy::POLICY_DOMAIN_CHROME, std::string())))
35 .WillRepeatedly(ReturnRef(policy_map_)); 35 .WillRepeatedly(ReturnRef(policy_map_));
36 } 36 }
37 37
38 protected: 38 protected:
39 class PolicyStringRunnable 39 class PolicyStringRunnable
40 : public ArcPolicyBridge::GetPoliciesCallback::Runnable { 40 : public ArcPolicyBridge::GetPoliciesCallback::Runnable {
41 public: 41 public:
42 explicit PolicyStringRunnable(mojo::String expected) 42 explicit PolicyStringRunnable(mojo::String expected)
43 : expected_(expected) {} 43 : expected_(expected) {}
44 void Run(const mojo::String& policies) const override { 44 void Run(const mojo::String& policies) override {
45 EXPECT_EQ(expected_, policies); 45 EXPECT_EQ(expected_, policies);
46 } 46 }
47 47
48 private: 48 private:
49 mojo::String expected_; 49 mojo::String expected_;
50 }; 50 };
51 51
52 class PolicyStringCallback : public ArcPolicyBridge::GetPoliciesCallback { 52 class PolicyStringCallback : public ArcPolicyBridge::GetPoliciesCallback {
53 public: 53 public:
54 explicit PolicyStringCallback(mojo::String expected) 54 explicit PolicyStringCallback(mojo::String expected)
(...skipping 25 matching lines...) Expand all
80 policy::POLICY_SCOPE_USER, policy::POLICY_SOURCE_CLOUD, 80 policy::POLICY_SCOPE_USER, policy::POLICY_SOURCE_CLOUD,
81 new base::StringValue("{\"application\": \"com.android.chrome\"}"), 81 new base::StringValue("{\"application\": \"com.android.chrome\"}"),
82 nullptr); 82 nullptr);
83 PolicyStringCallback chrome_callback( 83 PolicyStringCallback chrome_callback(
84 "{\"ArcApplicationPolicy\":" 84 "{\"ArcApplicationPolicy\":"
85 "\"{\\\"application\\\": \\\"com.android.chrome\\\"}\"}"); 85 "\"{\\\"application\\\": \\\"com.android.chrome\\\"}\"}");
86 policy_bridge()->GetPolicies(chrome_callback); 86 policy_bridge()->GetPolicies(chrome_callback);
87 } 87 }
88 88
89 } // namespace arc 89 } // namespace arc
OLDNEW
« no previous file with comments | « no previous file | mojo/public/cpp/bindings/callback.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698