public void WebBrowser_CreateSink_InvokeWithoutInstance_Nop(bool allowNavigation) { using var control = new SubWebBrowser { AllowNavigation = allowNavigation }; control.CreateSink(); Assert.Null(control.ActiveXInstance); Assert.False(control.IsHandleCreated); control.CreateSink(); Assert.Null(control.ActiveXInstance); Assert.False(control.IsHandleCreated); }
public void WebBrowser_CreateSink_InvokeWithoutInstance_Nop(bool allowNavigation) { var browser = new SubWebBrowser { AllowNavigation = allowNavigation }; browser.CreateSink(); Assert.Null(browser.ActiveXInstance); Assert.False(browser.IsHandleCreated); browser.CreateSink(); Assert.Null(browser.ActiveXInstance); Assert.False(browser.IsHandleCreated); }
public void WebBrowser_CreateSink_InvokeWithInstance_Success(bool allowNavigation) { using var parent = new Control(); using var control = new SubWebBrowser { AllowNavigation = allowNavigation, Parent = parent }; control.CreateSink(); Assert.NotNull(control.ActiveXInstance); Assert.True(control.IsHandleCreated); control.CreateSink(); Assert.NotNull(control.ActiveXInstance); Assert.True(control.IsHandleCreated); }
public void WebBrowser_AllowNavigation_SetWithSink_GetReturnsExpected(bool value) { var parent = new Control(); using var control = new SubWebBrowser { Parent = parent }; control.CreateSink(); control.AllowNavigation = value; Assert.Equal(value, control.AllowNavigation); Assert.NotNull(control.ActiveXInstance); Assert.True(control.IsHandleCreated); // Set same. control.AllowNavigation = value; Assert.Equal(value, control.AllowNavigation); Assert.NotNull(control.ActiveXInstance); Assert.True(control.IsHandleCreated); // Set different. control.AllowNavigation = !value; Assert.Equal(!value, control.AllowNavigation); Assert.NotNull(control.ActiveXInstance); Assert.True(control.IsHandleCreated); }
public void WebBrowser_CreateSink_InvokeWithInstance_Success(bool allowNavigation) { var parent = new Control(); var browser = new SubWebBrowser { AllowNavigation = allowNavigation, Parent = parent }; browser.CreateSink(); Assert.NotNull(browser.ActiveXInstance); Assert.True(browser.IsHandleCreated); browser.CreateSink(); Assert.NotNull(browser.ActiveXInstance); Assert.True(browser.IsHandleCreated); }