Commit d97ba0b8 authored by Finnur Thorarinsson's avatar Finnur Thorarinsson Committed by Commit Bot

[Android] PhotoPicker: Add Roboelectric test for PickerBitmapview.

Bug: 1006823, 656015
Change-Id: I47875b25a542ba6040eda7147449c7fb61d89024
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2132218
Commit-Queue: Finnur Thorarinsson <finnur@chromium.org>
Commit-Queue: Theresa  <twellington@chromium.org>
Auto-Submit: Finnur Thorarinsson <finnur@chromium.org>
Reviewed-by: default avatarTheresa  <twellington@chromium.org>
Cr-Commit-Position: refs/heads/master@{#755469}
parent 7d25a90d
......@@ -180,6 +180,7 @@ chrome_junit_test_java_sources = [
"junit/src/org/chromium/chrome/browser/password_manager/settings/TimedCallbackDelayerTest.java",
"junit/src/org/chromium/chrome/browser/payments/AutofillContactTest.java",
"junit/src/org/chromium/chrome/browser/payments/AutofillContactUnitTest.java",
"junit/src/org/chromium/chrome/browser/photo_picker/PickerBitmapViewTest.java",
"junit/src/org/chromium/chrome/browser/preferences/PrefServiceBridgeTest.java",
"junit/src/org/chromium/chrome/browser/privacy/settings/PrivacyPreferencesManagerTest.java",
"junit/src/org/chromium/chrome/browser/search_engines/SearchEngineChoiceMetricsTest.java",
......
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.chrome.browser.photo_picker;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RuntimeEnvironment;
import org.robolectric.annotation.Config;
import org.chromium.base.test.BaseRobolectricTestRunner;
import java.util.Collections;
/**
* junit tests for the {@link PickerBitmapView} class.
*/
@RunWith(BaseRobolectricTestRunner.class)
@Config(manifest = Config.NONE)
public class PickerBitmapViewTest {
@Test
public void testPrematureOnSelectionStateChanged() {
PickerBitmapView view =
new PickerBitmapView(RuntimeEnvironment.application.getApplicationContext(), null);
// Simulate crash scenario in crbug.com/1006823, where an event occurred before
// PickerBitmapView has been initialized.
view.onSelectionStateChange(Collections.emptyList());
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment