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

Unified Diff: chrome/browser/chromeos/arc/arc_navigation_throttle.h

Issue 2443313002: Add more tests to arc_navigation_throttle.cc (Closed)
Patch Set: address comments Created 4 years, 2 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: chrome/browser/chromeos/arc/arc_navigation_throttle.h
diff --git a/chrome/browser/chromeos/arc/arc_navigation_throttle.h b/chrome/browser/chromeos/arc/arc_navigation_throttle.h
index 18be29a51e610dde611914d4536bbae3b2aa11d1..8aa56db9650fb65f0140cb5d0bc42c99ba5d1c84 100644
--- a/chrome/browser/chromeos/arc/arc_navigation_throttle.h
+++ b/chrome/browser/chromeos/arc/arc_navigation_throttle.h
@@ -15,6 +15,7 @@
#include "base/memory/weak_ptr.h"
#include "components/arc/intent_helper/activity_icon_loader.h"
#include "content/public/browser/navigation_throttle.h"
+#include "mojo/public/cpp/bindings/array.h"
#include "ui/gfx/image/image.h"
class GURL;
@@ -66,6 +67,20 @@ class ArcNavigationThrottle : public content::NavigationThrottle {
static bool ShouldOverrideUrlLoadingForTesting(const GURL& previous_url,
const GURL& current_url);
+ // Finds |selected_app_package| from the |handlers| array and returns the
+ // index. If the app is not found, returns |handlers.size()|.
+ static size_t GetAppIndex(
+ const mojo::Array<mojom::IntentHandlerInfoPtr>& handlers,
+ const std::string& selected_app_package);
+
+ static bool IsAppAvailableForTesting(
+ const mojo::Array<mojom::IntentHandlerInfoPtr>& handlers);
+ static size_t FindPreferredAppForTesting(
+ const mojo::Array<mojom::IntentHandlerInfoPtr>& handlers);
+ static bool IsSwapElementsNeededForTesting(
+ const mojo::Array<mojom::IntentHandlerInfoPtr>& handlers,
+ std::pair<size_t, size_t>* out_indices);
+
private:
// content::Navigation implementation:
NavigationThrottle::ThrottleCheckResult WillStartRequest() override;
« no previous file with comments | « chrome/browser/chromeos/arc/arc_external_protocol_dialog.cc ('k') | chrome/browser/chromeos/arc/arc_navigation_throttle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698