Sha256: 6c844a1b818feae67df2ed2ceaf89946f8ddd20370de270ca3ff71233e3e061a

Contents?: true

Size: 820 Bytes

Versions: 11

Compression:

Stored size: 820 Bytes

Contents

activity org.ruboto.test_app.SslActivity

setup do |activity|
  start = Time.now
  loop do
    @text_view = activity.findViewById(42)
    @response_view = activity.findViewById(43)
    break if (@text_view && @response_view)|| (Time.now - start > 60)
    sleep 1
  end
  assert @text_view && @response_view
end

test('load net/https', :ui => false) do |activity|
  start = Time.now
  expected = 'net/https loaded OK!'
  response_expected = '<title>Google</title>'
  result = response = nil
  loop do
    activity.run_on_ui_thread do
      result = @text_view.text.to_s
      response = @response_view.text.to_s
    end
    break if (result == expected && response == response_expected) ||
        (Time.now - start > 60)
    sleep 0.5
  end
  assert_equal expected, result
  assert_equal response_expected, response
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
ruboto-1.6.1 test/activity/ssl_activity_test.rb
ruboto-1.6.0 test/activity/ssl_activity_test.rb
ruboto-1.5.0 test/activity/ssl_activity_test.rb
ruboto-1.4.1 test/activity/ssl_activity_test.rb
ruboto-1.4.0 test/activity/ssl_activity_test.rb
ruboto-1.3.1 test/activity/ssl_activity_test.rb
ruboto-1.3.0 test/activity/ssl_activity_test.rb
ruboto-1.2.0 test/activity/ssl_activity_test.rb
ruboto-1.1.2 test/activity/ssl_activity_test.rb
ruboto-1.1.1 test/activity/ssl_activity_test.rb
ruboto-1.1.0 test/activity/ssl_activity_test.rb