This repository has been archived by the owner on Nov 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 472
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #605: Include base64 support + review comments
- Loading branch information
1 parent
32e2064
commit 7a00a81
Showing
16 changed files
with
210 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
...ser/engine-system/src/main/java/mozilla/components/browser/engine/system/ScheduledLoad.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package mozilla.components.browser.engine.system | ||
|
||
/** | ||
* Used for when we need to schedule loading a url or data with a mime type, if there isn't | ||
* a session already created. | ||
*/ | ||
data class ScheduledLoad constructor( | ||
val url: String?, | ||
val data: String? = null, | ||
val mimeType: String? = null | ||
) { | ||
constructor(data: String, mimeType: String) : this(null, data, mimeType) | ||
constructor() : this(null, null, null) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...engine-system/src/test/java/mozilla/components/browser/engine/system/ScheduledLoadTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package mozilla.components.browser.engine.system | ||
|
||
import org.junit.Assert.assertNotNull | ||
import org.junit.Assert.assertNull | ||
import org.junit.Test | ||
|
||
class ScheduledLoadTest { | ||
@Test | ||
fun testConstructorNullability() { | ||
var scheduledLoad = ScheduledLoad() | ||
assertNull(scheduledLoad.url) | ||
assertNull(scheduledLoad.data) | ||
assertNull(scheduledLoad.mimeType) | ||
|
||
scheduledLoad = ScheduledLoad("https://mozilla.org") | ||
assertNotNull(scheduledLoad.url) | ||
assertNull(scheduledLoad.data) | ||
assertNull(scheduledLoad.mimeType) | ||
|
||
scheduledLoad = ScheduledLoad("<html><body></body></html>", "text/html") | ||
assertNull(scheduledLoad.url) | ||
assertNotNull(scheduledLoad.data) | ||
assertNotNull(scheduledLoad.mimeType) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.