| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/extensions/bookmark_app_helper.h" | 5 #include "chrome/browser/extensions/bookmark_app_helper.h" |
| 6 | 6 |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "chrome/browser/extensions/extension_service.h" | 8 #include "chrome/browser/extensions/extension_service.h" |
| 9 #include "chrome/browser/extensions/extension_service_test_base.h" | 9 #include "chrome/browser/extensions/extension_service_test_base.h" |
| 10 #include "chrome/common/extensions/manifest_handlers/app_launch_info.h" | 10 #include "chrome/common/extensions/manifest_handlers/app_launch_info.h" |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 | 110 |
| 111 } // namespace | 111 } // namespace |
| 112 | 112 |
| 113 namespace extensions { | 113 namespace extensions { |
| 114 | 114 |
| 115 class TestBookmarkAppHelper : public BookmarkAppHelper { | 115 class TestBookmarkAppHelper : public BookmarkAppHelper { |
| 116 public: | 116 public: |
| 117 TestBookmarkAppHelper(ExtensionService* service, | 117 TestBookmarkAppHelper(ExtensionService* service, |
| 118 WebApplicationInfo web_app_info, | 118 WebApplicationInfo web_app_info, |
| 119 content::WebContents* contents) | 119 content::WebContents* contents) |
| 120 : BookmarkAppHelper(service, web_app_info, contents) {} | 120 : BookmarkAppHelper(service->profile(), web_app_info, contents) {} |
| 121 | 121 |
| 122 ~TestBookmarkAppHelper() override {} | 122 ~TestBookmarkAppHelper() override {} |
| 123 | 123 |
| 124 void CreationComplete(const extensions::Extension* extension, | 124 void CreationComplete(const extensions::Extension* extension, |
| 125 const WebApplicationInfo& web_app_info) { | 125 const WebApplicationInfo& web_app_info) { |
| 126 extension_ = extension; | 126 extension_ = extension; |
| 127 } | 127 } |
| 128 | 128 |
| 129 void CompleteGetManifest(const content::Manifest& manifest) { | 129 void CompleteGetManifest(const content::Manifest& manifest) { |
| 130 BookmarkAppHelper::OnDidGetManifest(manifest); | 130 BookmarkAppHelper::OnDidGetManifest(manifest); |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 } | 358 } |
| 359 | 359 |
| 360 TEST_F(BookmarkAppHelperTest, IsValidBookmarkAppUrl) { | 360 TEST_F(BookmarkAppHelperTest, IsValidBookmarkAppUrl) { |
| 361 EXPECT_TRUE(IsValidBookmarkAppUrl(GURL("https://www.chromium.org"))); | 361 EXPECT_TRUE(IsValidBookmarkAppUrl(GURL("https://www.chromium.org"))); |
| 362 EXPECT_TRUE(IsValidBookmarkAppUrl(GURL("http://www.chromium.org/path"))); | 362 EXPECT_TRUE(IsValidBookmarkAppUrl(GURL("http://www.chromium.org/path"))); |
| 363 EXPECT_FALSE(IsValidBookmarkAppUrl(GURL("ftp://www.chromium.org"))); | 363 EXPECT_FALSE(IsValidBookmarkAppUrl(GURL("ftp://www.chromium.org"))); |
| 364 EXPECT_FALSE(IsValidBookmarkAppUrl(GURL("chrome://flags"))); | 364 EXPECT_FALSE(IsValidBookmarkAppUrl(GURL("chrome://flags"))); |
| 365 } | 365 } |
| 366 | 366 |
| 367 } // namespace extensions | 367 } // namespace extensions |
| OLD | NEW |