Using Robolectric with android.support.v7.app.MediaRouteButton
I have a View that includes an instance of android.support.v7.app.MediaRouteButton in its layout.
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="mykwillis.com.mediaroutebutton.MainActivity">
<android.support.v7.app.MediaRouteButton
android:id="@+id/video_layer_chromecast_button"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"/>
</android.support.constraint.ConstraintLayout>
I've created the beginning of a basic Robolectric test that does nothing more than build and create the MainActivity:
@RunWith(RobolectricTestRunner.class)
@Config(constants = BuildConfig.class)
public class MainActivityTest {
@Test
public void loadActivity() {
MainActivity activity = Robolectric.buildActivity(MainActivity.class).create().get();
}
}
When I try to run this test, I receive the following error:
android.view.InflateException: XML file build/intermediates/res/merged/debug/layout/activity_main.xml line #-1 (sorry, not yet implemented): XML file build/intermediates/res/merged/debug/layout/activity_main.xml line #-1 (sorry, not yet implemented): Error inflating class android.support.v7.app.MediaRouteButton
Caused by: android.view.InflateException: XML file build/intermediates/res/merged/debug/layout/activity_main.xml line #-1 (sorry, not yet implemented): Error inflating class android.support.v7.app.MediaRouteButton
Digging in deeper, it appears that Robolectric is failing when it tries to load the style information for MediaRouteButton. The relevant stack trace seems to be this:
Caused by: java.lang.ClassCastException: org.robolectric.res.AttrData cannot be cast to org.robolectric.res.StyleData at
org.robolectric.shadows.ShadowAssetManager.resolveStyle(ShadowAssetManager.java:617) at
org.robolectric.shadows.ShadowAssetManager.buildTypedValue(ShadowAssetManager.java:742) at
org.robolectric.shadows.ShadowAssetManager.attrsToTypedArray(ShadowAssetManager.java:793) at
org.robolectric.shadows.ShadowResourcesImpl$ShadowThemeImpl.obtainStyledAttributes(ShadowResourcesImpl.java:177) at android.content.res.ResourcesImpl$ThemeImpl.obtainStyledAttributes(ResourcesImpl.java) at
android.content.res.Resources$Theme.obtainStyledAttributes(Resources.java:1440) at android.content.Context.obtainStyledAttributes(Context.java:587) at
android.support.v7.app.MediaRouterThemeHelper.getThemeColor(MediaRouterThemeHelper.java:169) at
android.support.v7.app.MediaRouterThemeHelper.getControllerColor(MediaRouterThemeHelper.java:94) at
android.support.v7.app.MediaRouterThemeHelper.createThemedContext(MediaRouterThemeHelper.java:62) at android.support.v7.app.MediaRouteButton.(MediaRouteButton.java) at
android.view.LayoutInflater.createView(LayoutInflater.java:645)
I am using the following dependencies:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:25.3.0'
compile 'com.android.support:mediarouter-v7:25.3.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
testCompile "org.robolectric:robolectric:3.3.1"
testCompile 'org.khronos:opengl-api:gl1.1-android-2.1_r1' // https://github.com/robolectric/robolectric/issues/1932
}
I assume that this means I am out of luck with regard to Robolectric providing a Shadow for MediaRouteButton (provided by com.android.support:mediarouter-v7:25.3.0), and that I need to create a Shadow for this class myself. I followed the guide at http://robolectric.org/extending/ in an attempt to create a simple shadow that would at least allow my view to load, but to no avail. Here's what I created:
@Implements(android.support.v7.app.MediaRouteButton.class)
public class MediaRouteButtonShadow extends ShadowView {
public void __constructor__(Context context, AttributeSet attributeSet, int defStyle) {
}
}
And then I updated my @Config statement to be:
@Config(constants = BuildConfig.class, shadows = MediaRouteButtonShadow.class)
Unfortunately, I get the same error with this configuration.
Any pointers on how to create a minimal Shadow that will allow the view to load?
Update: a sample application demonstrating the problem is here: https://github.com/mykwillis/android-mediaroutebutton-test
add a comment |
I have a View that includes an instance of android.support.v7.app.MediaRouteButton in its layout.
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="mykwillis.com.mediaroutebutton.MainActivity">
<android.support.v7.app.MediaRouteButton
android:id="@+id/video_layer_chromecast_button"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"/>
</android.support.constraint.ConstraintLayout>
I've created the beginning of a basic Robolectric test that does nothing more than build and create the MainActivity:
@RunWith(RobolectricTestRunner.class)
@Config(constants = BuildConfig.class)
public class MainActivityTest {
@Test
public void loadActivity() {
MainActivity activity = Robolectric.buildActivity(MainActivity.class).create().get();
}
}
When I try to run this test, I receive the following error:
android.view.InflateException: XML file build/intermediates/res/merged/debug/layout/activity_main.xml line #-1 (sorry, not yet implemented): XML file build/intermediates/res/merged/debug/layout/activity_main.xml line #-1 (sorry, not yet implemented): Error inflating class android.support.v7.app.MediaRouteButton
Caused by: android.view.InflateException: XML file build/intermediates/res/merged/debug/layout/activity_main.xml line #-1 (sorry, not yet implemented): Error inflating class android.support.v7.app.MediaRouteButton
Digging in deeper, it appears that Robolectric is failing when it tries to load the style information for MediaRouteButton. The relevant stack trace seems to be this:
Caused by: java.lang.ClassCastException: org.robolectric.res.AttrData cannot be cast to org.robolectric.res.StyleData at
org.robolectric.shadows.ShadowAssetManager.resolveStyle(ShadowAssetManager.java:617) at
org.robolectric.shadows.ShadowAssetManager.buildTypedValue(ShadowAssetManager.java:742) at
org.robolectric.shadows.ShadowAssetManager.attrsToTypedArray(ShadowAssetManager.java:793) at
org.robolectric.shadows.ShadowResourcesImpl$ShadowThemeImpl.obtainStyledAttributes(ShadowResourcesImpl.java:177) at android.content.res.ResourcesImpl$ThemeImpl.obtainStyledAttributes(ResourcesImpl.java) at
android.content.res.Resources$Theme.obtainStyledAttributes(Resources.java:1440) at android.content.Context.obtainStyledAttributes(Context.java:587) at
android.support.v7.app.MediaRouterThemeHelper.getThemeColor(MediaRouterThemeHelper.java:169) at
android.support.v7.app.MediaRouterThemeHelper.getControllerColor(MediaRouterThemeHelper.java:94) at
android.support.v7.app.MediaRouterThemeHelper.createThemedContext(MediaRouterThemeHelper.java:62) at android.support.v7.app.MediaRouteButton.(MediaRouteButton.java) at
android.view.LayoutInflater.createView(LayoutInflater.java:645)
I am using the following dependencies:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:25.3.0'
compile 'com.android.support:mediarouter-v7:25.3.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
testCompile "org.robolectric:robolectric:3.3.1"
testCompile 'org.khronos:opengl-api:gl1.1-android-2.1_r1' // https://github.com/robolectric/robolectric/issues/1932
}
I assume that this means I am out of luck with regard to Robolectric providing a Shadow for MediaRouteButton (provided by com.android.support:mediarouter-v7:25.3.0), and that I need to create a Shadow for this class myself. I followed the guide at http://robolectric.org/extending/ in an attempt to create a simple shadow that would at least allow my view to load, but to no avail. Here's what I created:
@Implements(android.support.v7.app.MediaRouteButton.class)
public class MediaRouteButtonShadow extends ShadowView {
public void __constructor__(Context context, AttributeSet attributeSet, int defStyle) {
}
}
And then I updated my @Config statement to be:
@Config(constants = BuildConfig.class, shadows = MediaRouteButtonShadow.class)
Unfortunately, I get the same error with this configuration.
Any pointers on how to create a minimal Shadow that will allow the view to load?
Update: a sample application demonstrating the problem is here: https://github.com/mykwillis/android-mediaroutebutton-test
1
I am currently working around the problem by dynamically creating my MediaRouteButton conditionally (so I don't do it during Robolectric testing) which is obviously not ideal. I've created an issue with Robolectric here: github.com/robolectric/robolectric/issues/2991
– Myk Willis
Mar 22 '17 at 16:18
add a comment |
I have a View that includes an instance of android.support.v7.app.MediaRouteButton in its layout.
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="mykwillis.com.mediaroutebutton.MainActivity">
<android.support.v7.app.MediaRouteButton
android:id="@+id/video_layer_chromecast_button"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"/>
</android.support.constraint.ConstraintLayout>
I've created the beginning of a basic Robolectric test that does nothing more than build and create the MainActivity:
@RunWith(RobolectricTestRunner.class)
@Config(constants = BuildConfig.class)
public class MainActivityTest {
@Test
public void loadActivity() {
MainActivity activity = Robolectric.buildActivity(MainActivity.class).create().get();
}
}
When I try to run this test, I receive the following error:
android.view.InflateException: XML file build/intermediates/res/merged/debug/layout/activity_main.xml line #-1 (sorry, not yet implemented): XML file build/intermediates/res/merged/debug/layout/activity_main.xml line #-1 (sorry, not yet implemented): Error inflating class android.support.v7.app.MediaRouteButton
Caused by: android.view.InflateException: XML file build/intermediates/res/merged/debug/layout/activity_main.xml line #-1 (sorry, not yet implemented): Error inflating class android.support.v7.app.MediaRouteButton
Digging in deeper, it appears that Robolectric is failing when it tries to load the style information for MediaRouteButton. The relevant stack trace seems to be this:
Caused by: java.lang.ClassCastException: org.robolectric.res.AttrData cannot be cast to org.robolectric.res.StyleData at
org.robolectric.shadows.ShadowAssetManager.resolveStyle(ShadowAssetManager.java:617) at
org.robolectric.shadows.ShadowAssetManager.buildTypedValue(ShadowAssetManager.java:742) at
org.robolectric.shadows.ShadowAssetManager.attrsToTypedArray(ShadowAssetManager.java:793) at
org.robolectric.shadows.ShadowResourcesImpl$ShadowThemeImpl.obtainStyledAttributes(ShadowResourcesImpl.java:177) at android.content.res.ResourcesImpl$ThemeImpl.obtainStyledAttributes(ResourcesImpl.java) at
android.content.res.Resources$Theme.obtainStyledAttributes(Resources.java:1440) at android.content.Context.obtainStyledAttributes(Context.java:587) at
android.support.v7.app.MediaRouterThemeHelper.getThemeColor(MediaRouterThemeHelper.java:169) at
android.support.v7.app.MediaRouterThemeHelper.getControllerColor(MediaRouterThemeHelper.java:94) at
android.support.v7.app.MediaRouterThemeHelper.createThemedContext(MediaRouterThemeHelper.java:62) at android.support.v7.app.MediaRouteButton.(MediaRouteButton.java) at
android.view.LayoutInflater.createView(LayoutInflater.java:645)
I am using the following dependencies:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:25.3.0'
compile 'com.android.support:mediarouter-v7:25.3.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
testCompile "org.robolectric:robolectric:3.3.1"
testCompile 'org.khronos:opengl-api:gl1.1-android-2.1_r1' // https://github.com/robolectric/robolectric/issues/1932
}
I assume that this means I am out of luck with regard to Robolectric providing a Shadow for MediaRouteButton (provided by com.android.support:mediarouter-v7:25.3.0), and that I need to create a Shadow for this class myself. I followed the guide at http://robolectric.org/extending/ in an attempt to create a simple shadow that would at least allow my view to load, but to no avail. Here's what I created:
@Implements(android.support.v7.app.MediaRouteButton.class)
public class MediaRouteButtonShadow extends ShadowView {
public void __constructor__(Context context, AttributeSet attributeSet, int defStyle) {
}
}
And then I updated my @Config statement to be:
@Config(constants = BuildConfig.class, shadows = MediaRouteButtonShadow.class)
Unfortunately, I get the same error with this configuration.
Any pointers on how to create a minimal Shadow that will allow the view to load?
Update: a sample application demonstrating the problem is here: https://github.com/mykwillis/android-mediaroutebutton-test
I have a View that includes an instance of android.support.v7.app.MediaRouteButton in its layout.
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="mykwillis.com.mediaroutebutton.MainActivity">
<android.support.v7.app.MediaRouteButton
android:id="@+id/video_layer_chromecast_button"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"/>
</android.support.constraint.ConstraintLayout>
I've created the beginning of a basic Robolectric test that does nothing more than build and create the MainActivity:
@RunWith(RobolectricTestRunner.class)
@Config(constants = BuildConfig.class)
public class MainActivityTest {
@Test
public void loadActivity() {
MainActivity activity = Robolectric.buildActivity(MainActivity.class).create().get();
}
}
When I try to run this test, I receive the following error:
android.view.InflateException: XML file build/intermediates/res/merged/debug/layout/activity_main.xml line #-1 (sorry, not yet implemented): XML file build/intermediates/res/merged/debug/layout/activity_main.xml line #-1 (sorry, not yet implemented): Error inflating class android.support.v7.app.MediaRouteButton
Caused by: android.view.InflateException: XML file build/intermediates/res/merged/debug/layout/activity_main.xml line #-1 (sorry, not yet implemented): Error inflating class android.support.v7.app.MediaRouteButton
Digging in deeper, it appears that Robolectric is failing when it tries to load the style information for MediaRouteButton. The relevant stack trace seems to be this:
Caused by: java.lang.ClassCastException: org.robolectric.res.AttrData cannot be cast to org.robolectric.res.StyleData at
org.robolectric.shadows.ShadowAssetManager.resolveStyle(ShadowAssetManager.java:617) at
org.robolectric.shadows.ShadowAssetManager.buildTypedValue(ShadowAssetManager.java:742) at
org.robolectric.shadows.ShadowAssetManager.attrsToTypedArray(ShadowAssetManager.java:793) at
org.robolectric.shadows.ShadowResourcesImpl$ShadowThemeImpl.obtainStyledAttributes(ShadowResourcesImpl.java:177) at android.content.res.ResourcesImpl$ThemeImpl.obtainStyledAttributes(ResourcesImpl.java) at
android.content.res.Resources$Theme.obtainStyledAttributes(Resources.java:1440) at android.content.Context.obtainStyledAttributes(Context.java:587) at
android.support.v7.app.MediaRouterThemeHelper.getThemeColor(MediaRouterThemeHelper.java:169) at
android.support.v7.app.MediaRouterThemeHelper.getControllerColor(MediaRouterThemeHelper.java:94) at
android.support.v7.app.MediaRouterThemeHelper.createThemedContext(MediaRouterThemeHelper.java:62) at android.support.v7.app.MediaRouteButton.(MediaRouteButton.java) at
android.view.LayoutInflater.createView(LayoutInflater.java:645)
I am using the following dependencies:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:25.3.0'
compile 'com.android.support:mediarouter-v7:25.3.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
testCompile "org.robolectric:robolectric:3.3.1"
testCompile 'org.khronos:opengl-api:gl1.1-android-2.1_r1' // https://github.com/robolectric/robolectric/issues/1932
}
I assume that this means I am out of luck with regard to Robolectric providing a Shadow for MediaRouteButton (provided by com.android.support:mediarouter-v7:25.3.0), and that I need to create a Shadow for this class myself. I followed the guide at http://robolectric.org/extending/ in an attempt to create a simple shadow that would at least allow my view to load, but to no avail. Here's what I created:
@Implements(android.support.v7.app.MediaRouteButton.class)
public class MediaRouteButtonShadow extends ShadowView {
public void __constructor__(Context context, AttributeSet attributeSet, int defStyle) {
}
}
And then I updated my @Config statement to be:
@Config(constants = BuildConfig.class, shadows = MediaRouteButtonShadow.class)
Unfortunately, I get the same error with this configuration.
Any pointers on how to create a minimal Shadow that will allow the view to load?
Update: a sample application demonstrating the problem is here: https://github.com/mykwillis/android-mediaroutebutton-test
edited Mar 21 '17 at 20:27
Myk Willis
asked Mar 21 '17 at 18:17
Myk WillisMyk Willis
5,91411936
5,91411936
1
I am currently working around the problem by dynamically creating my MediaRouteButton conditionally (so I don't do it during Robolectric testing) which is obviously not ideal. I've created an issue with Robolectric here: github.com/robolectric/robolectric/issues/2991
– Myk Willis
Mar 22 '17 at 16:18
add a comment |
1
I am currently working around the problem by dynamically creating my MediaRouteButton conditionally (so I don't do it during Robolectric testing) which is obviously not ideal. I've created an issue with Robolectric here: github.com/robolectric/robolectric/issues/2991
– Myk Willis
Mar 22 '17 at 16:18
1
1
I am currently working around the problem by dynamically creating my MediaRouteButton conditionally (so I don't do it during Robolectric testing) which is obviously not ideal. I've created an issue with Robolectric here: github.com/robolectric/robolectric/issues/2991
– Myk Willis
Mar 22 '17 at 16:18
I am currently working around the problem by dynamically creating my MediaRouteButton conditionally (so I don't do it during Robolectric testing) which is obviously not ideal. I've created an issue with Robolectric here: github.com/robolectric/robolectric/issues/2991
– Myk Willis
Mar 22 '17 at 16:18
add a comment |
1 Answer
1
active
oldest
votes
This issue, tracked here, has been resolved using new functionality in Robolectric version 4.0.
Update dependencies and add a testOptions section to build.gradle:
dependencies {
// ...
testCompile "org.robolectric:robolectric:4.0"
}
testOptions {
unitTests {
includeAndroidResources = true
}
}
and add this line to gradle.properties:
enableUnitTestBinaryResources=true
Also make sure you've updated to the latest gradle plugin.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f42935170%2fusing-robolectric-with-android-support-v7-app-mediaroutebutton%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
This issue, tracked here, has been resolved using new functionality in Robolectric version 4.0.
Update dependencies and add a testOptions section to build.gradle:
dependencies {
// ...
testCompile "org.robolectric:robolectric:4.0"
}
testOptions {
unitTests {
includeAndroidResources = true
}
}
and add this line to gradle.properties:
enableUnitTestBinaryResources=true
Also make sure you've updated to the latest gradle plugin.
add a comment |
This issue, tracked here, has been resolved using new functionality in Robolectric version 4.0.
Update dependencies and add a testOptions section to build.gradle:
dependencies {
// ...
testCompile "org.robolectric:robolectric:4.0"
}
testOptions {
unitTests {
includeAndroidResources = true
}
}
and add this line to gradle.properties:
enableUnitTestBinaryResources=true
Also make sure you've updated to the latest gradle plugin.
add a comment |
This issue, tracked here, has been resolved using new functionality in Robolectric version 4.0.
Update dependencies and add a testOptions section to build.gradle:
dependencies {
// ...
testCompile "org.robolectric:robolectric:4.0"
}
testOptions {
unitTests {
includeAndroidResources = true
}
}
and add this line to gradle.properties:
enableUnitTestBinaryResources=true
Also make sure you've updated to the latest gradle plugin.
This issue, tracked here, has been resolved using new functionality in Robolectric version 4.0.
Update dependencies and add a testOptions section to build.gradle:
dependencies {
// ...
testCompile "org.robolectric:robolectric:4.0"
}
testOptions {
unitTests {
includeAndroidResources = true
}
}
and add this line to gradle.properties:
enableUnitTestBinaryResources=true
Also make sure you've updated to the latest gradle plugin.
answered Nov 21 '18 at 23:13
Myk WillisMyk Willis
5,91411936
5,91411936
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f42935170%2fusing-robolectric-with-android-support-v7-app-mediaroutebutton%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
I am currently working around the problem by dynamically creating my MediaRouteButton conditionally (so I don't do it during Robolectric testing) which is obviously not ideal. I've created an issue with Robolectric here: github.com/robolectric/robolectric/issues/2991
– Myk Willis
Mar 22 '17 at 16:18