@@ -1272,7 +1272,7 @@ describe('$location', function() {
1272
1272
1273
1273
1274
1274
it ( 'should not rewrite links with target="_blank"' , function ( ) {
1275
- configureService ( { linkHref : '/a?b=c' , html5Mode : true , supportHist : true , attrs : 'target="_blank"' } ) ;
1275
+ configureService ( { linkHref : 'base /a?b=c' , html5Mode : true , supportHist : true , attrs : 'target="_blank"' } ) ;
1276
1276
inject (
1277
1277
initBrowser ( ) ,
1278
1278
initLocation ( ) ,
@@ -1285,7 +1285,7 @@ describe('$location', function() {
1285
1285
1286
1286
1287
1287
it ( 'should not rewrite links with target specified' , function ( ) {
1288
- configureService ( { linkHref : '/a?b=c' , html5Mode : true , supportHist : true , attrs : 'target="some-frame"' } ) ;
1288
+ configureService ( { linkHref : 'base /a?b=c' , html5Mode : true , supportHist : true , attrs : 'target="some-frame"' } ) ;
1289
1289
inject (
1290
1290
initBrowser ( ) ,
1291
1291
initLocation ( ) ,
@@ -1480,7 +1480,7 @@ describe('$location', function() {
1480
1480
} ) ;
1481
1481
1482
1482
it ( 'should not rewrite when clicked with ctrl pressed' , function ( ) {
1483
- configureService ( { linkHref : '/a?b=c' , html5Mode : true , supportHist : true } ) ;
1483
+ configureService ( { linkHref : 'base /a?b=c' , html5Mode : true , supportHist : true } ) ;
1484
1484
inject (
1485
1485
initBrowser ( ) ,
1486
1486
initLocation ( ) ,
@@ -1493,7 +1493,7 @@ describe('$location', function() {
1493
1493
1494
1494
1495
1495
it ( 'should not rewrite when clicked with meta pressed' , function ( ) {
1496
- configureService ( { linkHref : '/a?b=c' , html5Mode : true , supportHist : true } ) ;
1496
+ configureService ( { linkHref : 'base /a?b=c' , html5Mode : true , supportHist : true } ) ;
1497
1497
inject (
1498
1498
initBrowser ( ) ,
1499
1499
initLocation ( ) ,
@@ -1504,6 +1504,40 @@ describe('$location', function() {
1504
1504
) ;
1505
1505
} ) ;
1506
1506
1507
+ it ( 'should not rewrite when right click pressed' , function ( ) {
1508
+ configureService ( { linkHref : 'base/a?b=c' , html5Mode : true , supportHist : true } ) ;
1509
+ inject (
1510
+ initBrowser ( ) ,
1511
+ initLocation ( ) ,
1512
+ function ( $browser ) {
1513
+ var rightClick ;
1514
+ if ( document . createEvent ) {
1515
+ rightClick = document . createEvent ( 'MouseEvents' ) ;
1516
+ rightClick . initMouseEvent ( 'click' , true , true , window , 1 , 10 , 10 , 10 , 10 , false ,
1517
+ false , false , false , 2 , null ) ;
1518
+
1519
+ link . dispatchEvent ( rightClick ) ;
1520
+ } else if ( document . createEventObject ) { // for IE
1521
+ rightClick = document . createEventObject ( ) ;
1522
+ rightClick . type = 'click' ;
1523
+ rightClick . cancelBubble = true ;
1524
+ rightClick . detail = 1 ;
1525
+ rightClick . screenX = 10 ;
1526
+ rightClick . screenY = 10 ;
1527
+ rightClick . clientX = 10 ;
1528
+ rightClick . clientY = 10 ;
1529
+ rightClick . ctrlKey = false ;
1530
+ rightClick . altKey = false ;
1531
+ rightClick . shiftKey = false ;
1532
+ rightClick . metaKey = false ;
1533
+ rightClick . button = 2 ;
1534
+ link . fireEvent ( 'onclick' , rightClick ) ;
1535
+ }
1536
+ expectNoRewrite ( $browser ) ;
1537
+ }
1538
+ ) ;
1539
+ } ) ;
1540
+
1507
1541
1508
1542
it ( 'should not rewrite when clicked with shift pressed' , function ( ) {
1509
1543
configureService ( { linkHref : 'base/a?b=c' , html5Mode : true , supportHist : true } ) ;
0 commit comments