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

Unified Diff: chrome/browser/android/webapps/add_to_homescreen_data_fetcher_unittest.cc

Issue 2385843002: Revert of Make it clear that AddToHomescreenDataFetcher ignores WebApplicationInfo for WebAPK (Closed)
Patch Set: Created 4 years, 3 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
« no previous file with comments | « chrome/browser/android/webapps/add_to_homescreen_data_fetcher.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/webapps/add_to_homescreen_data_fetcher_unittest.cc
diff --git a/chrome/browser/android/webapps/add_to_homescreen_data_fetcher_unittest.cc b/chrome/browser/android/webapps/add_to_homescreen_data_fetcher_unittest.cc
index b9180b21a2e4fb0b86d33c18992fe0ac1a8ebba7..4bde273d6c84339c88e6a67065b92da8b7503f1f 100644
--- a/chrome/browser/android/webapps/add_to_homescreen_data_fetcher_unittest.cc
+++ b/chrome/browser/android/webapps/add_to_homescreen_data_fetcher_unittest.cc
@@ -14,7 +14,6 @@
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
#include "base/strings/nullable_string16.h"
-#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
#include "chrome/common/web_application_info.h"
@@ -97,11 +96,7 @@
// called.
class ObserverWaiter : public AddToHomescreenDataFetcher::Observer {
public:
- ObserverWaiter()
- : is_webapk_compatible_(false),
- determined_webapk_compatibility_(false),
- title_available_(false),
- data_available_(false) {}
+ ObserverWaiter() {}
~ObserverWaiter() override {}
// Waits till the OnDataAvailable() callback is called.
@@ -280,59 +275,6 @@
DISALLOW_COPY_AND_ASSIGN(AddToHomescreenDataFetcherTestCommon);
};
-// Test that when the manifest provides Manifest::short_name but not
-// Manifest::name that Manifest::short_name is used as the name instead of
-// WebApplicationInfo::title.
-TEST_P(AddToHomescreenDataFetcherTestCommon,
- ManifestShortNameClobbersWebApplicationName) {
- WebApplicationInfo web_application_info;
- web_application_info.title = base::UTF8ToUTF16("Meta Title");
-
- content::Manifest manifest(BuildDefaultManifest());
- manifest.name = base::NullableString16();
-
- RegisterServiceWorker(GURL(kDefaultStartUrl));
- SetManifest(GURL(kDefaultManifestUrl), manifest, 0);
-
- ObserverWaiter waiter;
- scoped_refptr<AddToHomescreenDataFetcher> fetcher(BuildFetcher(&waiter));
- fetcher->OnDidGetWebApplicationInfo(web_application_info);
- waiter.WaitForDataAvailable();
-
- EXPECT_TRUE(base::EqualsASCII(fetcher->shortcut_info().name,
- kDefaultManifestShortName));
-
- fetcher->set_weak_observer(nullptr);
-}
-
-// Test that when the manifest does not provide either Manifest::short_name nor
-// Manifest::name that:
-// - The page is not WebAPK compatible.
-// - WebApplicationInfo::title is used as the "name".
-TEST_P(AddToHomescreenDataFetcherTestCommon, ManifestNoNameNoShortName) {
- const char* kWebApplicationInfoTitle = "Meta Title";
- WebApplicationInfo web_application_info;
- web_application_info.title = base::UTF8ToUTF16(kWebApplicationInfoTitle);
-
- content::Manifest manifest(BuildDefaultManifest());
- manifest.name = base::NullableString16();
- manifest.short_name = base::NullableString16();
-
- RegisterServiceWorker(GURL(kDefaultStartUrl));
- SetManifest(GURL(kDefaultManifestUrl), manifest, 0);
-
- ObserverWaiter waiter;
- scoped_refptr<AddToHomescreenDataFetcher> fetcher(BuildFetcher(&waiter));
- fetcher->OnDidGetWebApplicationInfo(web_application_info);
- waiter.WaitForDataAvailable();
-
- EXPECT_FALSE(waiter.is_webapk_compatible());
- EXPECT_TRUE(base::EqualsASCII(fetcher->shortcut_info().name,
- kWebApplicationInfoTitle));
-
- fetcher->set_weak_observer(nullptr);
-}
-
// Checks that the AddToHomescreenDataFetcher::Observer callbacks are called
// when a service worker is registered and the manifest fetch times out.
TEST_P(AddToHomescreenDataFetcherTestCommon, ManifestFetchTimesOut) {
« no previous file with comments | « chrome/browser/android/webapps/add_to_homescreen_data_fetcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698