Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 295253
Collapse All | Expand All

(-)src/org/eclipse/swt/widgets/Shell_Test.java (-2 / +22 lines)
Lines 114-120 Link Here
114
      // expected
114
      // expected
115
    }
115
    }
116
  }
116
  }
117
  
117
118
  public void testInitialValues() {
118
  public void testInitialValues() {
119
    Display display = new Display();
119
    Display display = new Display();
120
    Shell shell = new Shell( display, SWT.NONE );
120
    Shell shell = new Shell( display, SWT.NONE );
Lines 349-354 Link Here
349
    assertEquals( 0, log.size() );
349
    assertEquals( 0, log.size() );
350
  }
350
  }
351
351
352
  public void testActiveShellOnFocusControl() {
353
    final java.util.List log = new ArrayList();
354
    Display display = new Display();
355
    Shell shell = new Shell( display );
356
    Shell secondShell = new Shell( display );
357
    shell.open();
358
    secondShell.open();
359
    assertSame( secondShell, display.getActiveShell() );
360
    shell.addShellListener( new ShellAdapter() {
361
      public void shellActivated( final ShellEvent event ) {
362
        log.add( event );
363
      }
364
      public void shellDeactivated( final ShellEvent event ) {
365
      }
366
    } );
367
    Button button = new Button( shell, SWT.PUSH );
368
    button.setFocus();
369
    assertSame( shell, display.getActiveShell() );
370
    assertEquals( 1, log.size() );
371
  }
352
372
353
  /* test case to simulate the scenario reported in this bug:
373
  /* test case to simulate the scenario reported in this bug:
354
   * 278996: [Shell] Stackoverflow when closing child shell
374
   * 278996: [Shell] Stackoverflow when closing child shell
Lines 388-394 Link Here
388
    dialog.close();
408
    dialog.close();
389
    // no assert: test case is to ensure that no stack overflow occurs
409
    // no assert: test case is to ensure that no stack overflow occurs
390
  }
410
  }
391
  
411
392
  public void testNoDeactivateEventOnDispose() {
412
  public void testNoDeactivateEventOnDispose() {
393
    RWTFixture.fakePhase( PhaseId.PROCESS_ACTION );
413
    RWTFixture.fakePhase( PhaseId.PROCESS_ACTION );
394
    final StringBuffer log = new StringBuffer();
414
    final StringBuffer log = new StringBuffer();

Return to bug 295253