Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
apk_asset_provider_unittests.cc
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "flutter/shell/platform/android/apk_asset_provider.h"
6#include "gmock/gmock.h"
7#include "gtest/gtest.h"
8
9namespace flutter {
10namespace testing {
12 public:
13 MOCK_METHOD(std::unique_ptr<fml::Mapping>,
15 (const std::string& asset_name),
16 (const, override));
17};
18
19TEST(APKAssetProvider, CloneAndEquals) {
20 auto first_provider = std::make_unique<APKAssetProvider>(
21 std::make_shared<MockAPKAssetProviderImpl>());
22 auto second_provider = std::make_unique<APKAssetProvider>(
23 std::make_shared<MockAPKAssetProviderImpl>());
24 auto third_provider = first_provider->Clone();
25
26 ASSERT_NE(first_provider->GetImpl(), second_provider->GetImpl());
27 ASSERT_EQ(first_provider->GetImpl(), third_provider->GetImpl());
28 ASSERT_FALSE(*first_provider == *second_provider);
29 ASSERT_TRUE(*first_provider == *third_provider);
30}
31} // namespace testing
32} // namespace flutter
#define TEST(S, s, D, expected)
virtual std::unique_ptr< fml::Mapping > GetAsMapping(const std::string &asset_name) const =0
MOCK_METHOD(std::unique_ptr< fml::Mapping >, GetAsMapping,(const std::string &asset_name),(const, override))