Skip to content

Commit

Permalink
Test case for propagation of user features
Browse files Browse the repository at this point in the history
Summary:
When a feature is user-declared (e.g. in model generator), it shows up as "user features" in the `CallInfo::Declaration` frame. However, declaration frames do not show up in the UI. As a result, the user never sees where these features were introduced.

This stack will fix the issue. Meanwhile, this change adds a test case for the scenario.

Reviewed By: anwesht

Differential Revision: D47982621

fbshipit-source-id: 734e964584e199061e5e05ac167dcf0f18cb5069
  • Loading branch information
Yuh Shin Ong authored and facebook-github-bot committed Aug 3, 2023
1 parent 9e432b0 commit 3c5c45c
Show file tree
Hide file tree
Showing 8 changed files with 2,050 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

package com.facebook.marianatrench.integrationtests;

public class UserFeaturesPropagation {
// Expected frame properties:
// CallInfo::Declaration
// User feature(s): always:source1, always:source2
public Object source() {
return new Object();
}

// Expected frame properties:
// CallInfo::Origin
// Locally inferred feature(s): always:source1, always:source2
// Origin frames should contain user-declared features from the declaration
// as locally-inferred features.
public Object sourceHopDistance1() {
return this.source();
}

// Expected frame propeerties:
// CallInfo::CallSite
// Inferred features: always:source1, always:source2
// Call-site frames do not contain user features. These are considered
// (non-locally) inferred/propagated features at this point and must
// correspond to their respective source kinds.
public Object sourceHopDistance2() {
return this.sourceHopDistance1();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,361 @@
// @generated
{
"Landroid/app/Activity;.<init>:()V" :
{
"static" :
[
"Landroid/content/Context;.<init>:()V"
]
},
"Landroid/app/Activity;.getIntent:()Landroid/content/Intent;" :
{
"static" :
[
"Landroid/content/Intent;.<init>:()V"
]
},
"Landroid/content/ContentProvider;.<init>:()V" :
{
"static" :
[
"Ljava/lang/Object;.<init>:()V"
]
},
"Landroid/content/ContentProvider;.query:(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;" :
{
"static" :
[
"Landroid/database/Cursor;.<init>:()V"
]
},
"Landroid/content/Context;.<init>:()V" :
{
"static" :
[
"Ljava/lang/Object;.<init>:()V"
]
},
"Landroid/content/Intent;.<init>:()V" :
{
"static" :
[
"Ljava/lang/Object;.<init>:()V"
]
},
"Landroid/content/Intent;.<init>:(Landroid/content/Context;Ljava/lang/Class;)V" :
{
"static" :
[
"Ljava/lang/Object;.<init>:()V"
]
},
"Landroid/content/Intent;.<init>:(Ljava/lang/String;Landroid/net/Uri;)V" :
{
"static" :
[
"Ljava/lang/Object;.<init>:()V"
]
},
"Landroid/content/Intent;.getBundleExtra:(Ljava/lang/String;)Landroid/os/Bundle;" :
{
"static" :
[
"Landroid/os/Bundle;.<init>:()V"
]
},
"Landroid/content/Intent;.getData:()Landroid/net/Uri;" :
{
"static" :
[
"Landroid/net/Uri;.<init>:()V"
]
},
"Landroid/content/Intent;.getExtras:()Landroid/os/Bundle;" :
{
"static" :
[
"Landroid/os/Bundle;.<init>:()V"
]
},
"Landroid/database/Cursor;.<init>:()V" :
{
"static" :
[
"Ljava/lang/Object;.<init>:()V"
]
},
"Landroid/location/Location;.<init>:()V" :
{
"static" :
[
"Ljava/lang/Object;.<init>:()V"
]
},
"Landroid/net/Uri$Builder;.<init>:()V" :
{
"static" :
[
"Ljava/lang/Object;.<init>:()V"
]
},
"Landroid/net/Uri$Builder;.build:()Landroid/net/Uri;" :
{
"static" :
[
"Landroid/net/Uri;.<init>:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V"
]
},
"Landroid/net/Uri;.<init>:()V" :
{
"static" :
[
"Ljava/lang/Object;.<init>:()V"
]
},
"Landroid/net/Uri;.<init>:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V" :
{
"static" :
[
"Ljava/lang/Object;.<init>:()V"
]
},
"Landroid/net/Uri;.parse:(Ljava/lang/String;)Landroid/net/Uri;" :
{
"static" :
[
"Landroid/net/Uri;.<init>:()V"
]
},
"Landroid/net/Uri;.toString:()Ljava/lang/String;" :
{
"virtual" :
[
"Ljava/lang/String;.concat:(Ljava/lang/String;)Ljava/lang/String;"
]
},
"Landroid/os/Bundle;.<init>:()V" :
{
"static" :
[
"Ljava/lang/Object;.<init>:()V"
]
},
"Landroid/text/TextUtils;.<init>:()V" :
{
"static" :
[
"Ljava/lang/Object;.<init>:()V"
]
},
"Landroid/util/Log;.<init>:()V" :
{
"static" :
[
"Ljava/lang/Object;.<init>:()V"
]
},
"Landroid/webkit/WebViewClient;.<init>:()V" :
{
"static" :
[
"Ljava/lang/Object;.<init>:()V"
]
},
"Landroidx/fragment/app/FragmentActivity;.<init>:()V" :
{
"static" :
[
"Landroid/app/Activity;.<init>:()V"
]
},
"Lcom/facebook/auth/datastore/LoggedInUserAuthDataStore;.<init>:()V" :
{
"static" :
[
"Ljava/lang/Object;.<init>:()V"
]
},
"Lcom/facebook/auth/datastore/LoggedInUserAuthDataStore;.getLoggedInUser:()Lcom/facebook/user/model/User;" :
{
"static" :
[
"Lcom/facebook/user/model/User;.<init>:()V"
]
},
"Lcom/facebook/base/activity/FragmentBaseActivityUtil;.<init>:()V" :
{
"static" :
[
"Ljava/lang/Object;.<init>:()V"
]
},
"Lcom/facebook/base/activity/FragmentBaseActivityUtil;.getDefaultActivityIntent:()Landroid/content/Intent;" :
{
"static" :
[
"Landroid/content/Intent;.<init>:()V"
]
},
"Lcom/facebook/content/SecureContextHelper;.<init>:()V" :
{
"static" :
[
"Ljava/lang/Object;.<init>:()V"
]
},
"Lcom/facebook/marianatrench/integrationtests/Origin;.<init>:()V" :
{
"static" :
[
"Ljava/lang/Object;.<init>:()V"
]
},
"Lcom/facebook/marianatrench/integrationtests/Origin;.source:()Ljava/lang/Object;" :
{
"static" :
[
"Ljava/lang/Object;.<init>:()V"
]
},
"Lcom/facebook/marianatrench/integrationtests/UserFeaturesPropagation;.<init>:()V" :
{
"static" :
[
"Ljava/lang/Object;.<init>:()V"
]
},
"Lcom/facebook/marianatrench/integrationtests/UserFeaturesPropagation;.source:()Ljava/lang/Object;" :
{
"static" :
[
"Ljava/lang/Object;.<init>:()V"
]
},
"Lcom/facebook/marianatrench/integrationtests/UserFeaturesPropagation;.sourceHopDistance1:()Ljava/lang/Object;" :
{
"virtual" :
[
"Lcom/facebook/marianatrench/integrationtests/UserFeaturesPropagation;.source:()Ljava/lang/Object;"
]
},
"Lcom/facebook/marianatrench/integrationtests/UserFeaturesPropagation;.sourceHopDistance2:()Ljava/lang/Object;" :
{
"virtual" :
[
"Lcom/facebook/marianatrench/integrationtests/UserFeaturesPropagation;.sourceHopDistance1:()Ljava/lang/Object;"
]
},
"Lcom/facebook/secure/context/IntentLauncher;.<init>:()V" :
{
"static" :
[
"Ljava/lang/Object;.<init>:()V"
]
},
"Lcom/facebook/secure/context/SecureContextHelperV2;.<init>:()V" :
{
"static" :
[
"Ljava/lang/Object;.<init>:()V"
]
},
"Lcom/facebook/secure/context/SecureContextHelperV2;.get:()Lcom/facebook/secure/context/SecureContextHelperV2;" :
{
"static" :
[
"Lcom/facebook/secure/context/SecureContextHelperV2;.<init>:()V"
]
},
"Lcom/facebook/secure/context/SecureContextHelperV2;.inAppBrowser:()Lcom/facebook/secure/context/IntentLauncher;" :
{
"static" :
[
"Lcom/facebook/secure/context/IntentLauncher;.<init>:()V"
]
},
"Lcom/facebook/secure/context/SecureContextHelperV2;.internal:()Lcom/facebook/secure/context/IntentLauncher;" :
{
"static" :
[
"Lcom/facebook/secure/context/IntentLauncher;.<init>:()V"
]
},
"Lcom/facebook/user/model/User;.<init>:()V" :
{
"static" :
[
"Ljava/lang/Object;.<init>:()V"
]
},
"Lcom/instagram/common/analytics/IgAnalyticsLogger;.<init>:()V" :
{
"static" :
[
"Ljava/lang/Object;.<init>:()V"
]
},
"Lcom/instagram/common/analytics/IgAnalyticsLogger;.getInstance:()Lcom/instagram/common/analytics/IgAnalyticsLogger;" :
{
"static" :
[
"Lcom/instagram/common/analytics/IgAnalyticsLogger;.<init>:()V"
]
},
"Lcom/instagram/common/analytics/intf/AnalyticsEvent;.<init>:()V" :
{
"static" :
[
"Ljava/lang/Object;.<init>:()V"
]
},
"Lcom/instagram/common/analytics/intf/AnalyticsEvent;.obtain:(Ljava/lang/String;)Lcom/instagram/common/analytics/intf/AnalyticsEvent;" :
{
"static" :
[
"Lcom/instagram/common/analytics/intf/AnalyticsEvent;.<init>:()V"
]
},
"Ljava/lang/Integer;.<init>:()V" :
{
"static" :
[
"Ljava/lang/Object;.<init>:()V"
]
},
"Ljava/lang/String;.<init>:()V" :
{
"static" :
[
"Ljava/lang/Object;.<init>:()V"
]
},
"Ljava/lang/String;.concat:(Ljava/lang/String;)Ljava/lang/String;" :
{
"virtual" :
[
"Ljava/lang/String;.isEmpty:()Z"
]
},
"Ljava/lang/Thread;.<init>:(Ljava/lang/Runnable;)V" :
{
"static" :
[
"Ljava/lang/Object;.<init>:()V"
]
},
"Ljava/lang/Thread;.run:()V" :
{
"virtual" :
[
"Ljava/lang/Runnable;.run:()V",
"Ljava/lang/Thread;.run:()V"
]
},
"Ljava/util/TreeMap;.<init>:()V" :
{
"static" :
[
"Ljava/lang/Object;.<init>:()V"
]
}
}
Loading

0 comments on commit 3c5c45c

Please sign in to comment.