| OLD | NEW | 
|---|
| 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  Loading... | 
| 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  Loading... | 
| 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 | 
| OLD | NEW | 
|---|