mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 17:32:44 +00:00 
			
		
		
		
	 08221139a5
			
		
	
	
		08221139a5
		
	
	
	
	
		
			
			This allows you to not have to write a separate test file for the same thing but in a different situation. This doesn't handle when you change the page with location.href however. Changes the name of the page load handlers to prevent confusion with this.
		
			
				
	
	
		
			19 lines
		
	
	
	
		
			573 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			19 lines
		
	
	
	
		
			573 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| loadPage("file:///res/html/misc/blank.html");
 | |
| 
 | |
| afterInitialPageLoad(() => {
 | |
|     test("atob", () => {
 | |
|         expect(atob("YQ==")).toBe("a");
 | |
|         expect(atob("YWE=")).toBe("aa");
 | |
|         expect(atob("YWFh")).toBe("aaa");
 | |
|         expect(atob("YWFhYQ==")).toBe("aaaa");
 | |
|         expect(atob("/w==")).toBe("\xff");
 | |
|     });
 | |
| 
 | |
|     test("btoa", () => {
 | |
|         expect(btoa("a")).toBe("YQ==");
 | |
|         expect(btoa("aa")).toBe("YWE=");
 | |
|         expect(btoa("aaa")).toBe("YWFh");
 | |
|         expect(btoa("aaaa")).toBe("YWFhYQ==");
 | |
|         expect(btoa("\xff")).toBe("/w==");
 | |
|     });
 | |
| });
 |