Sha256: 95a6f9becb64e39329d9178d320b7b41e7304092041af297240bb69266fcfe00

Contents?: true

Size: 870 Bytes

Versions: 20

Compression:

Stored size: 870 Bytes

Contents

# frozen_string_literal: true

require "test_helper"

class AndroidAppTest < Minitest::Test
  let(:browser) { Browser.new(Browser["ANDROID_WEBVIEW"]) }

  test "detect as android" do
    assert browser.platform.android?
  end

  test "detect as webview" do
    assert browser.platform.android_webview?
  end

  test "non-webviews do not detect as webview" do
    %w[
      ANDROID_CUPCAKE
      ANDROID_DONUT
      ANDROID_ECLAIR_21
      ANDROID_FROYO
      ANDROID_GINGERBREAD
      ANDROID_HONEYCOMB_30
      ANDROID_ICECREAM
      ANDROID_JELLYBEAN_41
      ANDROID_JELLYBEAN_42
      ANDROID_JELLYBEAN_43
      ANDROID_KITKAT
      ANDROID_LOLLIPOP_50
      ANDROID_LOLLIPOP_51
      ANDROID_TV
      ANDROID_NEXUS_PLAYER
      FIREFOX_ANDROID
    ].each do |android_type|
      refute Browser.new(Browser[android_type]).platform.android_webview?
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
browser-5.3.1 test/unit/android_app_test.rb
browser-5.3.0 test/unit/android_app_test.rb
browser-5.2.0 test/unit/android_app_test.rb
browser-5.1.0 test/unit/android_app_test.rb
browser-5.0.0 test/unit/android_app_test.rb
browser-4.2.0 test/unit/android_app_test.rb
browser-4.1.0 test/unit/android_app_test.rb
browser-4.0.0 test/unit/android_app_test.rb
browser-3.0.3 test/unit/android_app_test.rb
browser-3.0.2 test/unit/android_app_test.rb
browser-3.0.1 test/unit/android_app_test.rb
browser-3.0.0 test/unit/android_app_test.rb
browser-2.7.1 test/unit/android_app_test.rb
browser-2.7.0 test/unit/android_app_test.rb
browser-2.6.1 test/unit/android_app_test.rb
browser-2.6.0 test/unit/android_app_test.rb
browser-2.5.3 test/unit/android_app_test.rb
browser-2.5.2 test/unit/android_app_test.rb
browser-2.5.1 test/unit/android_app_test.rb
browser-2.5.0 test/unit/android_app_test.rb