blob: 888e70b374317f5d386e574b9d574948d9a2aefa [file] [log] [blame]
#include "flutter/shell/platform/android/apk_asset_provider.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
namespace flutter {
namespace testing {
class MockAPKAssetProviderImpl : public APKAssetProviderInternal {
public:
MOCK_CONST_METHOD1(
GetAsMapping,
std::unique_ptr<fml::Mapping>(const std::string& asset_name));
};
TEST(APKAssetProvider, Clone) {
auto first_provider = std::make_unique<APKAssetProvider>(
std::make_shared<MockAPKAssetProviderImpl>());
auto second_provider = std::make_unique<APKAssetProvider>(
std::make_shared<MockAPKAssetProviderImpl>());
auto third_provider = first_provider->Clone();
ASSERT_NE(first_provider->GetImpl(), second_provider->GetImpl());
ASSERT_EQ(first_provider->GetImpl(), third_provider->GetImpl());
}
} // namespace testing
} // namespace flutter