Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jdk17u
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
einsteinathome
openjdk
jdk17u
Commits
4d147bf2
Commit
4d147bf2
authored
7 months ago
by
t.ogata
Committed by
Paul Hohensee
7 months ago
Browse files
Options
Downloads
Patches
Plain Diff
8328379: Convert URLDragTest.html applet test to main
Backport-of: fbeac98c84078a566c572abeba07c49e94bbf26b
parent
c436edbe
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
test/jdk/java/awt/dnd/URLDragTest.java
+40
-34
40 additions, 34 deletions
test/jdk/java/awt/dnd/URLDragTest.java
test/jdk/java/awt/dnd/URLDragTest/URLDragTest.html
+0
-45
0 additions, 45 deletions
test/jdk/java/awt/dnd/URLDragTest/URLDragTest.html
with
40 additions
and
79 deletions
test/jdk/java/awt/dnd/URLDragTest
/URLDragTest
.java
→
test/jdk/java/awt/dnd/URLDragTest.java
+
40
−
34
View file @
4d147bf2
/*
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014,
2024,
Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -21,20 +21,8 @@
* questions.
*/
/*
test
@bug 8031964
@summary Dragging images from the browser does not work
@author Petr Pchelko : area=dnd
@library ../../regtesthelpers
@build Sysout
@run applet/manual=yesno URLDragTest.html
*/
import
test.java.awt.regtesthelpers.Sysout
;
import
java.applet.Applet
;
import
java.awt.*
;
import
java.awt.Color
;
import
java.awt.Frame
;
import
java.awt.datatransfer.DataFlavor
;
import
java.awt.dnd.DnDConstants
;
import
java.awt.dnd.DropTarget
;
...
...
@@ -42,13 +30,41 @@ import java.awt.dnd.DropTargetAdapter;
import
java.awt.dnd.DropTargetDragEvent
;
import
java.awt.dnd.DropTargetDropEvent
;
public
class
URLDragTest
extends
Applet
{
/*
* @test
* @bug 8031964
* @summary Dragging images from the browser does not work.
* @library /java/awt/regtesthelpers
* @build PassFailJFrame
* @run main/manual URLDragTest
*/
public
class
URLDragTest
{
private
static
final
String
INSTRUCTIONS
=
"""
1) When the test starts, open any browser.
2) Drag any image from the browser page onto the RED window.
3) When the image is dropped you should see the list of available
DataFlavors in the log area below the instruction window.
4) If you see application/x-java-url and text/uri-list flavors in
the logs then please press PASS, else FAIL.
"""
;
public
static
void
main
(
String
[]
args
)
throws
Exception
{
PassFailJFrame
.
builder
()
.
title
(
"Test Instructions"
)
.
instructions
(
INSTRUCTIONS
)
.
rows
((
int
)
INSTRUCTIONS
.
lines
().
count
()
+
2
)
.
columns
(
40
)
.
logArea
(
8
)
.
testUI
(
URLDragTest:
:
createUI
)
.
build
()
.
awaitAndCheck
();
}
@Override
public
void
init
()
{
setBackground
(
Color
.
red
);
setDropTarget
(
new
DropTarget
(
this
,
private
static
Frame
createUI
()
{
Frame
frame
=
new
Frame
(
"Browser Image DnD Test"
);
frame
.
setBackground
(
Color
.
RED
);
frame
.
setDropTarget
(
new
DropTarget
(
frame
,
DnDConstants
.
ACTION_COPY
,
new
DropTargetAdapter
()
{
@Override
...
...
@@ -67,22 +83,12 @@ public class URLDragTest extends Applet {
dtde
.
getCurrentDataFlavorsAsList
()
.
stream
()
.
map
(
DataFlavor:
:
toString
)
.
forEach
(
Sysout:
:
println
);
.
forEach
(
PassFailJFrame:
:
log
);
}
}));
String
[]
instructions
=
{
"1) Open the browser."
,
"2) Drag any image from the browser page to the red square"
,
"3) When the image is dropped you should se the list of available DataFlavors"
,
"4) If you see application/x-java-url and text/uri-list flavors - test PASSED"
,
"5) Otherwise the test is FAILED"
};
Sysout
.
createDialogWithInstructions
(
instructions
);
}
@Override
public
void
start
()
{
setSize
(
200
,
200
);
setVisible
(
true
);
frame
.
setSize
(
400
,
200
);
frame
.
setAlwaysOnTop
(
true
);
return
frame
;
}
}
This diff is collapsed.
Click to expand it.
test/jdk/java/awt/dnd/URLDragTest/URLDragTest.html
deleted
100644 → 0
+
0
−
45
View file @
c436edbe
<!--
Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
This code is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License version 2 only, as
published by the Free Software Foundation.
This code is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
version 2 for more details (a copy is included in the LICENSE file that
accompanied this code).
You should have received a copy of the GNU General Public License version
2 along with this work; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
or visit www.oracle.com if you need additional information or have any
questions.
-->
<html>
<!--
@test
@bug 8031964
@summary Dragging images from the browser does not work
@author Petr Pchelko : area=dnd
@library ../../regtesthelpers
@build Sysout
@run applet/manual=yesno URLDragTest.html
-->
<head>
<title>
DnD of URL across JVM
</title>
</head>
<body>
<h1>
URLDragTest
<br>
Bug ID: 8031964
</h1>
<p>
This is an AUTOMATIC test, simply wait for completion
</p>
<APPLET
CODE=
"URLDragTest.class"
WIDTH=
200
HEIGHT=
200
></APPLET>
</body>
</html>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment