No Results
Search Tips:
- Please consider misspellings
- Try different search keywords
Newer Version Available
mockRenderContext(Map<String,String>,Map<String,String>)
Creates and returns a test Canvas.RenderContext
based on the provided application and environment context parameters.
Signature
public static Canvas.RenderContext mockRenderContext(Map<String,String> appContextTestValues, Map<String,String> envContextTestValues)
Parameters
- appContextTestValues
- Type: Map<String,String>
- Specifies a map of key-value pairs that provide mock application context data. Use constants that are provided by Canvas.Test as keys. If null is provided for this parameter, the canvas framework will generate some default mock application context values.
- envContextTestValues
- Type: Map<String,String>
- Specifies a map of key-value pairs that provide mock environment context data. Use constants provided by Canvas.Test as keys. If null is provided for this parameter, the canvas framework will generate some default mock environment context values.
Return Value
Type: Canvas.RenderContext
Usage
Use this method to create a mock Canvas.RenderContext. Use the returned RenderContext in calls to Canvas.Test.testCanvasLifecycle(Canvas.CanvasLifecycleHandler, Canvas.RenderContext) for testing Canvas.CanvasLifecycleHandler implementations.
Example
The following example creates maps to represent mock application and environment context data and generates a test Canvas.RenderContext. This test RenderContext can be used in a call to Canvas.Test.testCanvasLifecycle(Canvas.CanvasLifecycleHandler, Canvas.RenderContext).
1swfobject.registerObject("clippy.codeblock-0", "9");Map<String,String> appValues = new Map<String,String>();
2appValues.put(Canvas.Test.KEY_NAMESPACE,'alternateNamespace');
3appValues.put(Canvas.Test.KEY_VERSION,'3.0');
4
5Map<String,String> envValues = new Map<String,String>();
6envValues.put(Canvas.Test.KEY_DISPLAY_LOCATION,'Chatter');
7envValues.put(Canvas.Test.KEY_LOCATION_URL,'https://na1.salesforce.com/_ui/core/chatter/ui/ChatterPage');
8
9Canvas.RenderContext mock = Canvas.Test.mockRenderContext(appValues,envValues);