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

Unified Diff: android_webview/native/aw_media_url_interceptor_unittest.cc

Issue 2863233002: [WebView] Move files from native to browser (Closed)
Patch Set: Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: android_webview/native/aw_media_url_interceptor_unittest.cc
diff --git a/android_webview/native/aw_media_url_interceptor_unittest.cc b/android_webview/native/aw_media_url_interceptor_unittest.cc
deleted file mode 100644
index b43dab987b44f2416d79439bfbc56a4f2d302884..0000000000000000000000000000000000000000
--- a/android_webview/native/aw_media_url_interceptor_unittest.cc
+++ /dev/null
@@ -1,73 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "android_webview/native/aw_media_url_interceptor.h"
-
-#include <memory>
-#include <string>
-
-#include "testing/gtest/include/gtest/gtest.h"
-
-using testing::Test;
-
-namespace android_webview {
-
-namespace {
-
-// Sentinel value to check whether the fields have been set.
-const int UNSET_VALUE = -1;
-
-class AwMediaUrlInterceptorTest : public Test {
- public:
- AwMediaUrlInterceptorTest()
- : fd_(UNSET_VALUE), offset_(UNSET_VALUE), size_(UNSET_VALUE),
- url_interceptor_(new AwMediaUrlInterceptor()){
- }
- protected:
- int fd_;
- int64_t offset_;
- int64_t size_;
- std::unique_ptr<AwMediaUrlInterceptor> url_interceptor_;
-};
-
-} // namespace
-
-TEST_F(AwMediaUrlInterceptorTest, TestInterceptValidAssetUrl) {
- // This asset file exists in the android_webview_unittests-debug.apk.
- // See gyp rule android_webview_unittests_apk.
- const std::string valid_asset_url(
- "file:///android_asset/asset_file.ogg");
-
- ASSERT_TRUE(url_interceptor_->Intercept(
- valid_asset_url, &fd_, &offset_, &size_));
- EXPECT_NE(UNSET_VALUE, fd_);
- EXPECT_NE(UNSET_VALUE, offset_);
- EXPECT_NE(UNSET_VALUE, size_);
-}
-
-TEST_F(AwMediaUrlInterceptorTest, TestInterceptInvalidAssetUrl) {
- // This asset file does not exist in the android_webview_unittests-debug.apk.
- // See gyp rule android_webview_unittests_apk.
- const std::string invalid_asset_url(
- "file:///android_asset/file_does_not_exist.ogg");
-
- ASSERT_FALSE(url_interceptor_->Intercept(
- invalid_asset_url, &fd_, &offset_, &size_));
- EXPECT_EQ(UNSET_VALUE, fd_);
- EXPECT_EQ(UNSET_VALUE, offset_);
- EXPECT_EQ(UNSET_VALUE, size_);
-}
-
-TEST_F(AwMediaUrlInterceptorTest, TestInterceptNonAssetUrl) {
- // This url does not refer to an asset in the apk.
- const std::string non_asset_url("file:///sdcard/file.txt");
-
- ASSERT_FALSE(url_interceptor_->Intercept(
- non_asset_url, &fd_, &offset_, &size_));
- EXPECT_EQ(UNSET_VALUE, fd_);
- EXPECT_EQ(UNSET_VALUE, offset_);
- EXPECT_EQ(UNSET_VALUE, size_);
-}
-
-} // namespace android_webview

Powered by Google App Engine
This is Rietveld 408576698