12c131bbf81d8c02ade163b939c96e44aa93765e9Alex Deymo//
22c131bbf81d8c02ade163b939c96e44aa93765e9Alex Deymo// Copyright (C) 2016 The Android Open Source Project
32c131bbf81d8c02ade163b939c96e44aa93765e9Alex Deymo//
42c131bbf81d8c02ade163b939c96e44aa93765e9Alex Deymo// Licensed under the Apache License, Version 2.0 (the "License");
52c131bbf81d8c02ade163b939c96e44aa93765e9Alex Deymo// you may not use this file except in compliance with the License.
62c131bbf81d8c02ade163b939c96e44aa93765e9Alex Deymo// You may obtain a copy of the License at
72c131bbf81d8c02ade163b939c96e44aa93765e9Alex Deymo//
82c131bbf81d8c02ade163b939c96e44aa93765e9Alex Deymo//      http://www.apache.org/licenses/LICENSE-2.0
92c131bbf81d8c02ade163b939c96e44aa93765e9Alex Deymo//
102c131bbf81d8c02ade163b939c96e44aa93765e9Alex Deymo// Unless required by applicable law or agreed to in writing, software
112c131bbf81d8c02ade163b939c96e44aa93765e9Alex Deymo// distributed under the License is distributed on an "AS IS" BASIS,
122c131bbf81d8c02ade163b939c96e44aa93765e9Alex Deymo// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
132c131bbf81d8c02ade163b939c96e44aa93765e9Alex Deymo// See the License for the specific language governing permissions and
142c131bbf81d8c02ade163b939c96e44aa93765e9Alex Deymo// limitations under the License.
152c131bbf81d8c02ade163b939c96e44aa93765e9Alex Deymo//
162c131bbf81d8c02ade163b939c96e44aa93765e9Alex Deymo
172c131bbf81d8c02ade163b939c96e44aa93765e9Alex Deymo#include "update_engine/common/file_fetcher.h"
182c131bbf81d8c02ade163b939c96e44aa93765e9Alex Deymo
192c131bbf81d8c02ade163b939c96e44aa93765e9Alex Deymo#include <string>
202c131bbf81d8c02ade163b939c96e44aa93765e9Alex Deymo
212c131bbf81d8c02ade163b939c96e44aa93765e9Alex Deymo#include <gtest/gtest.h>
222c131bbf81d8c02ade163b939c96e44aa93765e9Alex Deymo
232c131bbf81d8c02ade163b939c96e44aa93765e9Alex Deymo#include "update_engine/common/test_utils.h"
242c131bbf81d8c02ade163b939c96e44aa93765e9Alex Deymo
252c131bbf81d8c02ade163b939c96e44aa93765e9Alex Deymonamespace chromeos_update_engine {
262c131bbf81d8c02ade163b939c96e44aa93765e9Alex Deymo
272c131bbf81d8c02ade163b939c96e44aa93765e9Alex Deymoclass FileFetcherUnitTest : public ::testing::Test {};
282c131bbf81d8c02ade163b939c96e44aa93765e9Alex Deymo
292c131bbf81d8c02ade163b939c96e44aa93765e9Alex DeymoTEST_F(FileFetcherUnitTest, SupporterUrlsTest) {
302c131bbf81d8c02ade163b939c96e44aa93765e9Alex Deymo  EXPECT_TRUE(FileFetcher::SupportedUrl("file:///path/to/somewhere.bin"));
312c131bbf81d8c02ade163b939c96e44aa93765e9Alex Deymo  EXPECT_TRUE(FileFetcher::SupportedUrl("FILE:///I/LIKE/TO/SHOUT"));
322c131bbf81d8c02ade163b939c96e44aa93765e9Alex Deymo
332c131bbf81d8c02ade163b939c96e44aa93765e9Alex Deymo  EXPECT_FALSE(FileFetcher::SupportedUrl("file://relative"));
342c131bbf81d8c02ade163b939c96e44aa93765e9Alex Deymo  EXPECT_FALSE(FileFetcher::SupportedUrl("http:///no_http_here"));
352c131bbf81d8c02ade163b939c96e44aa93765e9Alex Deymo}
362c131bbf81d8c02ade163b939c96e44aa93765e9Alex Deymo
372c131bbf81d8c02ade163b939c96e44aa93765e9Alex Deymo}  // namespace chromeos_update_engine
38