| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/browser/renderer_host/pepper/pepper_file_system_browser_host.h
" | 5 #include "content/browser/renderer_host/pepper/pepper_file_system_browser_host.h
" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "content/browser/renderer_host/pepper/browser_ppapi_host_test.h" | 11 #include "content/browser/renderer_host/pepper/browser_ppapi_host_test.h" |
| 12 #include "ppapi/c/pp_instance.h" | 12 #include "ppapi/c/pp_instance.h" |
| 13 #include "ppapi/c/pp_resource.h" | 13 #include "ppapi/c/pp_resource.h" |
| 14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
| 15 | 15 |
| 16 namespace content { | 16 namespace content { |
| 17 | 17 |
| 18 class PepperFileSystemBrowserHostTest : public testing::Test, | 18 class PepperFileSystemBrowserHostTest : public testing::Test, |
| 19 public BrowserPpapiHostTest { | 19 public BrowserPpapiHostTest { |
| 20 public: | 20 public: |
| 21 PepperFileSystemBrowserHostTest() {} | 21 PepperFileSystemBrowserHostTest() {} |
| 22 virtual ~PepperFileSystemBrowserHostTest() {} | 22 virtual ~PepperFileSystemBrowserHostTest() {} |
| 23 | 23 |
| 24 virtual void SetUp() OVERRIDE { | 24 virtual void SetUp() override { |
| 25 PP_Instance pp_instance = 12345; | 25 PP_Instance pp_instance = 12345; |
| 26 PP_Resource pp_resource = 67890; | 26 PP_Resource pp_resource = 67890; |
| 27 host_.reset(new PepperFileSystemBrowserHost(GetBrowserPpapiHost(), | 27 host_.reset(new PepperFileSystemBrowserHost(GetBrowserPpapiHost(), |
| 28 pp_instance, | 28 pp_instance, |
| 29 pp_resource, | 29 pp_resource, |
| 30 PP_FILESYSTEMTYPE_ISOLATED)); | 30 PP_FILESYSTEMTYPE_ISOLATED)); |
| 31 } | 31 } |
| 32 | 32 |
| 33 virtual void TearDown() OVERRIDE { host_.reset(); } | 33 virtual void TearDown() override { host_.reset(); } |
| 34 | 34 |
| 35 protected: | 35 protected: |
| 36 std::string GeneratePluginId(const std::string& mime_type) { | 36 std::string GeneratePluginId(const std::string& mime_type) { |
| 37 return host_->GeneratePluginId(mime_type); | 37 return host_->GeneratePluginId(mime_type); |
| 38 } | 38 } |
| 39 | 39 |
| 40 private: | 40 private: |
| 41 scoped_ptr<PepperFileSystemBrowserHost> host_; | 41 scoped_ptr<PepperFileSystemBrowserHost> host_; |
| 42 | 42 |
| 43 DISALLOW_COPY_AND_ASSIGN(PepperFileSystemBrowserHostTest); | 43 DISALLOW_COPY_AND_ASSIGN(PepperFileSystemBrowserHostTest); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 69 // Valid cases. | 69 // Valid cases. |
| 70 EXPECT_EQ("application_mime", GeneratePluginId("application/mime")); | 70 EXPECT_EQ("application_mime", GeneratePluginId("application/mime")); |
| 71 EXPECT_EQ("x-app_mime", GeneratePluginId("x-app/mime")); | 71 EXPECT_EQ("x-app_mime", GeneratePluginId("x-app/mime")); |
| 72 EXPECT_EQ("application_mime.type", GeneratePluginId("application/mime.type")); | 72 EXPECT_EQ("application_mime.type", GeneratePluginId("application/mime.type")); |
| 73 EXPECT_EQ("application_mime_type", GeneratePluginId("application/mime_type")); | 73 EXPECT_EQ("application_mime_type", GeneratePluginId("application/mime_type")); |
| 74 EXPECT_EQ("application_mime-type", GeneratePluginId("application/mime-type")); | 74 EXPECT_EQ("application_mime-type", GeneratePluginId("application/mime-type")); |
| 75 EXPECT_EQ("application_..", GeneratePluginId("application/..")); | 75 EXPECT_EQ("application_..", GeneratePluginId("application/..")); |
| 76 } | 76 } |
| 77 | 77 |
| 78 } // namespace content | 78 } // namespace content |
| OLD | NEW |